From b4a70306209e836d635dc284f13ccda6d9229089 Mon Sep 17 00:00:00 2001 From: Guillem Vela Date: Fri, 28 Feb 2020 00:27:01 +0100 Subject: [PATCH] [CCMA] Avoid exception when 'utc' is not found --- youtube_dl/extractor/ccma.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/ccma.py b/youtube_dl/extractor/ccma.py index d4873860a..21de10b23 100644 --- a/youtube_dl/extractor/ccma.py +++ b/youtube_dl/extractor/ccma.py @@ -88,8 +88,11 @@ class CCMAIE(InfoExtractor): # utc date is in format YYYY-DD-MM data_utc = informacio.get('data_emissio', {}).get('utc') - data_iso8601 = data_utc[:5] + data_utc[8:10] + '-' + data_utc[5:7] + data_utc[10:] - timestamp = parse_iso8601(data_iso8601) + try: + data_iso8601 = data_utc[:5] + data_utc[8:10] + '-' + data_utc[5:7] + data_utc[10:] + timestamp = parse_iso8601(data_iso8601) + except TypeError: + timestamp = None subtitles = {} subtitols = media.get('subtitols', [])