mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Don't break if no audio tags. Fixes #473
This commit is contained in:
parent
984aeb77bc
commit
1443a81927
1 changed files with 8 additions and 2 deletions
|
@ -149,9 +149,15 @@ def buildCommands(file, newDir):
|
||||||
used_audio = 0
|
used_audio = 0
|
||||||
a_mapped = []
|
a_mapped = []
|
||||||
if audioStreams:
|
if audioStreams:
|
||||||
audio1 = [ item for item in audioStreams if item["tags"]["language"] == nzbtomedia.ALANGUAGE ]
|
try:
|
||||||
|
audio1 = [ item for item in audioStreams if item["tags"]["language"] == nzbtomedia.ALANGUAGE ]
|
||||||
|
except: # no language tags. Assume only 1 language.
|
||||||
|
audio1 = audioStreams
|
||||||
audio2 = [ item for item in audio1 if item["codec_name"] in nzbtomedia.ACODEC_ALLOW ]
|
audio2 = [ item for item in audio1 if item["codec_name"] in nzbtomedia.ACODEC_ALLOW ]
|
||||||
audio3 = [ item for item in audioStreams if item["tags"]["language"] != nzbtomedia.ALANGUAGE ]
|
try:
|
||||||
|
audio3 = [ item for item in audioStreams if item["tags"]["language"] != nzbtomedia.ALANGUAGE ]
|
||||||
|
except:
|
||||||
|
audio3 = []
|
||||||
|
|
||||||
if audio2: # right language and codec...
|
if audio2: # right language and codec...
|
||||||
map_cmd.extend(['-map', '0:' + str(audio2[0]["index"])])
|
map_cmd.extend(['-map', '0:' + str(audio2[0]["index"])])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue