Check for existence of codec_type key when counting streams

This commit is contained in:
Dam4rusxp 2016-11-17 22:49:06 +01:00 committed by GitHub
parent 26957918e5
commit 57f6907922

View file

@ -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.",