Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Sep 24, 2021
1 parent 7005f13 commit aa8ae3e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bot/helper/ext_utils/fs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit aa8ae3e

Please sign in to comment.