1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 13:44:14 +01:00

postprocess: figure out audio_filename before looking for tracks

This commit is contained in:
Johannes Holmberg 2019-09-23 22:53:51 +02:00 committed by Johan Andersson
parent 1721ca1003
commit 806fc1d9d7

View File

@ -104,7 +104,11 @@ class postprocess:
orig_filename = formatname(self.stream.output, self.config, self.stream.output_extention)
name, ext = os.path.splitext(orig_filename)
audio_filename = "{}.audio.ts".format(name)
if ext == ".ts":
audio_filename = "{}.audio.ts".format(name)
else:
audio_filename = "{}.m4a".format(name)
cmd = [self.detect, "-i", orig_filename, "-i", audio_filename]
_, stdout, stderr = run_program(cmd, False) # return 1 is good here.
streams = _streams(stderr)
@ -120,8 +124,6 @@ class postprocess:
if ext == ".ts":
if audiotrack and "aac" in _getcodec(streams, audiotrack):
arguments += ["-bsf:a", "aac_adtstoasc"]
else:
audio_filename = "{}.m4a".format(name)
cmd = [self.detect, "-i", orig_filename, "-i", audio_filename]
if videotrack:
arguments += ["-map", "{}".format(videotrack)]