From aa8ae3e4cfbd2d11b92b09dd6938b9e23eff44a4 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Fri, 24 Sep 2021 01:43:08 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- bot/helper/ext_utils/fs_utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bot/helper/ext_utils/fs_utils.py b/bot/helper/ext_utils/fs_utils.py index 62304df1062..961500edecc 100644 --- a/bot/helper/ext_utils/fs_utils.py +++ b/bot/helper/ext_utils/fs_utils.py @@ -162,10 +162,7 @@ def take_ss(video_file): os.mkdir(des_dir) des_dir = os.path.join(des_dir, f"{time.time()}.jpg") metadata = extractMetadata(createParser(video_file)) - if metadata.has("duration"): - duration = metadata.get('duration').seconds - else: - duration = 5 + duration = metadata.get('duration').seconds if metadata.has("duration") else 5 duration = int(duration) / 2 subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-ss", str(duration), "-i", video_file, "-vframes", "1", des_dir])