Skip to content

Commit

Permalink
Auto-format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 7, 2025
1 parent ffb9731 commit 3042d9e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bot/helper/aeon_utils/caption_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@ async def generate_caption(filename, directory, caption_template):

media_data = mediainfo_data.get("media", {})
track_data = media_data.get("track", [])
video_metadata = next((track for track in track_data if track["@type"] == "Video"), {})
video_metadata = next(
(track for track in track_data if track["@type"] == "Video"), {}
)
audio_metadata = [track for track in track_data if track["@type"] == "Audio"]
subtitle_metadata = [track for track in track_data if track["@type"] == "Text"]

video_duration = video_metadata.get("Duration", 0)
video_quality = get_video_quality(video_metadata.get("Height"))

audio_languages = ", ".join(
parse_audio_language("", audio) for audio in audio_metadata if audio.get("Language")
parse_audio_language("", audio)
for audio in audio_metadata
if audio.get("Language")
)
subtitle_languages = ", ".join(
parse_subtitle_language("", subtitle)
Expand Down Expand Up @@ -111,4 +115,4 @@ def calculate_md5(file_path):
with open(file_path, "rb") as file:
for chunk in iter(lambda: file.read(4096), b""):
md5_hash.update(chunk)
return md5_hash.hexdigest()
return md5_hash.hexdigest()

0 comments on commit 3042d9e

Please sign in to comment.