forked from rDrama/rDrama
remove new files if they exist too
parent
0dc9e1e35a
commit
32910c5cf5
|
@ -114,6 +114,8 @@ def convert_to_mp4(old, new, vid, db):
|
||||||
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-threads:v", "1", "-i", old, "-map_metadata", "-1", tmp], check=True, stderr=subprocess.STDOUT)
|
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-threads:v", "1", "-i", old, "-map_metadata", "-1", tmp], check=True, stderr=subprocess.STDOUT)
|
||||||
except:
|
except:
|
||||||
os.remove(old)
|
os.remove(old)
|
||||||
|
if os.path.isfile(tmp):
|
||||||
|
os.remove(tmp)
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
os.replace(tmp, new)
|
os.replace(tmp, new)
|
||||||
|
@ -161,6 +163,8 @@ def process_video(file, v):
|
||||||
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True)
|
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True)
|
||||||
except:
|
except:
|
||||||
os.remove(old)
|
os.remove(old)
|
||||||
|
if os.path.isfile(new):
|
||||||
|
os.remove(new)
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
os.remove(old)
|
os.remove(old)
|
||||||
|
|
Loading…
Reference in New Issue