1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00

remux only if file is not mp4

This commit is contained in:
iwconfig 2016-06-02 01:47:25 +02:00
parent cf7380211f
commit 4f6c4821d7

View File

@ -17,10 +17,12 @@ class postprocess(object):
def remux(self):
if self.detect is None:
log.error("Cant detect ffmpeg or avconv. cant mux files without it")
log.error("Cant detect ffmpeg or avconv. Cant mux files without it.")
return
if self.stream.finished is False:
return
if self.stream.options.output.endswith('.mp4') is False:
orig_filename = self.stream.options.output
new_name = "{0}.mp4".format(os.path.splitext(self.stream.options.output)[0])
@ -40,13 +42,13 @@ class postprocess(object):
msg = stderr.strip().split('\n')[-1]
log.error("Something went wrong: %s", msg)
return
log.info("Muxing done. removing the old file.")
log.info("Muxing done, removing the old file.")
os.remove(self.stream.options.output)
os.rename(tempfile, new_name)
def merge(self):
if self.detect is None:
log.error("Cant detect ffmpeg or avconv. cant mux files without it")
log.error("Cant detect ffmpeg or avconv. Cant mux files without it.")
return
if self.stream.finished is False: