Skip to content

Commit

Permalink
update caption_gen.py
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 7, 2025
1 parent d59edb4 commit a673c21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/helper/aeon_utils/caption_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit a673c21

Please sign in to comment.