From 3042d9eaf4e53fc8a4934ca6963dcef43f418e56 Mon Sep 17 00:00:00 2001 From: 5hojib Date: Tue, 7 Jan 2025 06:37:03 +0000 Subject: [PATCH] Auto-format code [skip actions] --- bot/helper/aeon_utils/caption_gen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bot/helper/aeon_utils/caption_gen.py b/bot/helper/aeon_utils/caption_gen.py index 3ff3bb057..564d69744 100644 --- a/bot/helper/aeon_utils/caption_gen.py +++ b/bot/helper/aeon_utils/caption_gen.py @@ -34,7 +34,9 @@ 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"] @@ -42,7 +44,9 @@ async def generate_caption(filename, directory, caption_template): 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) @@ -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() \ No newline at end of file + return md5_hash.hexdigest()