1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

_checktracks: support for language in the stream

This commit is contained in:
Johan Andersson 2018-06-24 21:55:18 +02:00
parent 17a7f28fe6
commit 7aba2589ec

View File

@ -213,14 +213,14 @@ class postprocess(object):
os.rename(tempfile, orig_filename) os.rename(tempfile, orig_filename)
def _checktracks(self, output): def _checktracks(self, output):
allstuff = re.findall("Stream \#\d:(\d)\[[^\[]+\]: (Video|Audio): (.*)", output) allstuff = re.findall("Stream \#\d:(\d)\[[^\[]+\]([\(\)\w]+)?: (Video|Audio): (.*)", output)
videotrack = 0 videotrack = 0
audiotrack = 1 audiotrack = 1
for stream in allstuff: for stream in allstuff:
if stream[1] == "Video": if stream[2] == "Video":
videotrack = stream[0] videotrack = stream[0]
if stream[1] == "Audio": if stream[2] == "Audio":
if stream[2] == "mp3, 0 channels": if stream[3] == "mp3, 0 channels":
continue continue
audiotrack = stream[0] audiotrack = stream[0]