From 57f69079223ec4415afbb4a24d81c3fc8f0c3392 Mon Sep 17 00:00:00 2001 From: Dam4rusxp Date: Thu, 17 Nov 2016 22:49:06 +0100 Subject: [PATCH] Check for existence of codec_type key when counting streams --- core/transcoder/transcoder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/transcoder/transcoder.py b/core/transcoder/transcoder.py index 85e68e4a..79329e2a 100644 --- a/core/transcoder/transcoder.py +++ b/core/transcoder/transcoder.py @@ -26,8 +26,8 @@ def isVideoGood(videofile, status): disable = True logger.info("DISABLED: ffprobe failed to analyse test file. Stopping corruption check.", 'TRANSCODER') if test_details.get("streams"): - vidStreams = [item for item in test_details["streams"] if item["codec_type"] == "video"] - audStreams = [item for item in test_details["streams"] if item["codec_type"] == "audio"] + vidStreams = [item for item in test_details["streams"] if "codec_type" in item and item["codec_type"] == "video"] + audStreams = [item for item in test_details["streams"] if "codec_type" in item and item["codec_type"] == "audio"] if not (len(vidStreams) > 0 and len(audStreams) > 0): disable = True logger.info("DISABLED: ffprobe failed to analyse streams from test file. Stopping corruption check.",