Skip to content

Commit

Permalink
Fixup. Format code with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 24, 2025
1 parent 2bb32d7 commit 112218e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pod/import_video/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
More information on this module at: https://www.esup-portail.org/wiki/x/BQCnSw
"""

import logging
import os
import requests
Expand Down Expand Up @@ -752,10 +753,7 @@ def upload_youtube_recording_to_pod(request, record_id: int):
# Use pytubefix to download Youtube file
# Manage Proof of Origin Token generation
# See https://pytubefix.readthedocs.io/en/latest/user/po_token.html
yt_video = YouTube(
source_url,
'WEB'
)
yt_video = YouTube(source_url, "WEB")
# Publish date (format: 2023-05-13 00:00:00)
# Event date (format: 2023-05-13)
date_evt = str(yt_video.publish_date)[0:10]
Expand Down Expand Up @@ -908,7 +906,9 @@ def upload_peertube_recording_to_pod(request, record_id: int) -> bool: # noqa:
# Source video file
if not pt_video_json["files"]:
# Source video file for a playlist
source_video_url = pt_video_json["streamingPlaylists"][0]["files"][0]["fileDownloadUrl"]
source_video_url = pt_video_json["streamingPlaylists"][0]["files"][0][
"fileDownloadUrl"
]
else:
# Source video file for a video
source_video_url = pt_video_json["files"][0]["fileDownloadUrl"]
Expand Down
4 changes: 3 additions & 1 deletion pod/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,9 @@ def get_thumbnail_admin(self):
if self.thumbnail and self.thumbnail.file_exist():
# Handle exception to avoid sending an error email
try:
im = get_thumbnail(self.thumbnail.file, "100x100", crop="center", quality=72)
im = get_thumbnail(
self.thumbnail.file, "100x100", crop="center", quality=72
)
thumbnail_url = im.url
except Exception:
thumbnail_url = static(DEFAULT_THUMBNAIL)
Expand Down

0 comments on commit 112218e

Please sign in to comment.