From c93ccdb25098e21e28d0c36f34edcb5521c70316 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 13 Feb 2024 17:22:31 +0200 Subject: [PATCH] fix this https://rdrama.net/post/245598/whats-with-this-error-marseybeanquestion-it --- files/helpers/media.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index b9ada6a51..14596b01e 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -159,7 +159,7 @@ def process_video(file, v): try: video_info = ffmpeg.probe(old)['streams'][0] codec = video_info['codec_name'] - bitrate = int(video_info['bit_rate']) + bitrate = int(video_info.get('bit_rate', 3000000)) except: os.remove(old) abort(400, "Something went wrong processing your video and it might be on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.") @@ -167,7 +167,7 @@ def process_video(file, v): if codec != 'h264': copyfile(old, new) gevent.spawn(reencode_video, old, new) - elif bitrate > 3000000: + elif bitrate >= 3000000: copyfile(old, new) gevent.spawn(reencode_video, old, new, True) else: