mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-06 05:01:10 -07:00
catch errors if not audio codec name. Fixes #1109
This commit is contained in:
parent
14be873c7c
commit
07f419640c
1 changed files with 8 additions and 2 deletions
|
@ -259,7 +259,10 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
|||
audio1 = [item for item in audioStreams if item["tags"]["language"] == core.ALANGUAGE]
|
||||
except: # no language tags. Assume only 1 language.
|
||||
audio1 = audioStreams
|
||||
audio2 = [item for item in audio1 if item["codec_name"] in core.ACODEC_ALLOW]
|
||||
try:
|
||||
audio2 = [item for item in audio1 if item["codec_name"] in core.ACODEC_ALLOW]
|
||||
except:
|
||||
audio2 = []
|
||||
try:
|
||||
audio3 = [item for item in audioStreams if item["tags"]["language"] != core.ALANGUAGE]
|
||||
except:
|
||||
|
@ -301,7 +304,10 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
|||
|
||||
if core.ACODEC2_ALLOW:
|
||||
used_audio += 1
|
||||
audio4 = [item for item in audio1 if item["codec_name"] in core.ACODEC2_ALLOW]
|
||||
try:
|
||||
audio4 = [item for item in audio1 if item["codec_name"] in core.ACODEC2_ALLOW]
|
||||
except:
|
||||
audio4 = []
|
||||
if audio4: # right language and codec.
|
||||
map_cmd.extend(['-map', '0:{index}'.format(index=audio4[0]["index"])])
|
||||
a_mapped.extend([audio4[0]["index"]])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue