fix 500 error
parent
c9dd229b55
commit
79301d7be3
|
@ -170,6 +170,7 @@ def process_video(file, v):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
video_info = ffmpeg.probe(old)['streams']
|
video_info = ffmpeg.probe(old)['streams']
|
||||||
|
codec = None
|
||||||
for stream in video_info:
|
for stream in video_info:
|
||||||
if stream["codec_type"] == "video":
|
if stream["codec_type"] == "video":
|
||||||
codec = stream['codec_name']
|
codec = stream['codec_name']
|
||||||
|
@ -179,6 +180,10 @@ def process_video(file, v):
|
||||||
os.remove(old)
|
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.")
|
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
|
is_reencoding = False
|
||||||
if codec != 'h264':
|
if codec != 'h264':
|
||||||
copyfile(old, new)
|
copyfile(old, new)
|
||||||
|
|
Loading…
Reference in New Issue