fix 500 error

master
Aevann 2024-04-11 15:41:59 +02:00
parent c9dd229b55
commit 79301d7be3
1 changed files with 5 additions and 0 deletions

View File

@ -170,6 +170,7 @@ def process_video(file, v):
try:
video_info = ffmpeg.probe(old)['streams']
codec = None
for stream in video_info:
if stream["codec_type"] == "video":
codec = stream['codec_name']
@ -179,6 +180,10 @@ def process_video(file, v):
os.remove(old)
abort(400, "Something went wrong processing your video on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.")
if not codec:
os.remove(old)
abort(400, "Something went wrong processing your video on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.")
is_reencoding = False
if codec != 'h264':
copyfile(old, new)