From 07f419640c2eb64ba04eb614e88d08752117545d Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Fri, 7 Oct 2016 22:47:01 +1030 Subject: [PATCH] catch errors if not audio codec name. Fixes #1109 --- core/transcoder/transcoder.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/transcoder/transcoder.py b/core/transcoder/transcoder.py index cdb8b233..5554ed98 100644 --- a/core/transcoder/transcoder.py +++ b/core/transcoder/transcoder.py @@ -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"]])