From a673c21a1d9e017edb8ef01c97d145108dd3ecfa Mon Sep 17 00:00:00 2001 From: 5hojib Date: Tue, 7 Jan 2025 12:49:03 +0600 Subject: [PATCH] update caption_gen.py --- bot/helper/aeon_utils/caption_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/helper/aeon_utils/caption_gen.py b/bot/helper/aeon_utils/caption_gen.py index f4165d5ca..c7711454a 100644 --- a/bot/helper/aeon_utils/caption_gen.py +++ b/bot/helper/aeon_utils/caption_gen.py @@ -41,7 +41,7 @@ async def generate_caption(filename, directory, caption_template): 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_duration = round(float(video_metadata.get("Duration", 0))) video_quality = get_video_quality(video_metadata.get("Height")) audio_languages = ", ".join( @@ -63,7 +63,7 @@ async def generate_caption(filename, directory, caption_template): caption_data = DefaultDict( filename=filename, size=get_readable_file_size(await aiopath.getsize(file_path)), - duration=get_readable_time(int(video_duration), True), + duration=get_readable_time(video_duration, True), quality=video_quality, audios=audio_languages, subtitles=subtitle_languages,