From fbaa4a8b82ba488edbc80b91485d395f444951f3 Mon Sep 17 00:00:00 2001 From: Zach Knox Date: Mon, 5 Mar 2018 19:44:22 -0500 Subject: [PATCH 1/3] Allow download to continue even if it can't find AssetType This doesn't necesserily result in a successful download due to ffmpeg not supporting SAMPLE-AES encryption, but will let you see formats in -F, and you'll likely find a working one not far down the list --- youtube_dl/extractor/cbs.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/cbs.py b/youtube_dl/extractor/cbs.py index 1268e38ef..126a881fd 100644 --- a/youtube_dl/extractor/cbs.py +++ b/youtube_dl/extractor/cbs.py @@ -7,6 +7,7 @@ from ..utils import ( xpath_element, xpath_text, update_url_query, + ExtractorError ) @@ -74,9 +75,12 @@ class CBSIE(CBSBaseIE): query['formats'] = 'MPEG4,M3U' elif asset_type in ('RTMP', 'WIFI', '3G'): query['formats'] = 'MPEG4,FLV' - tp_formats, tp_subtitles = self._extract_theplatform_smil( - update_url_query(tp_release_url, query), content_id, - 'Downloading %s SMIL data' % asset_type) + try: + tp_formats, tp_subtitles = self._extract_theplatform_smil( + update_url_query(tp_release_url, query), content_id, + 'Downloading %s SMIL data' % asset_type) + except ExtractorError: + continue formats.extend(tp_formats) subtitles = self._merge_subtitles(subtitles, tp_subtitles) self._sort_formats(formats) From dbcc399240021413ea60b318b3e5105c2bd69b4d Mon Sep 17 00:00:00 2001 From: Zach Knox Date: Mon, 5 Mar 2018 21:41:17 -0500 Subject: [PATCH 2/3] added a few more lines to the try/except and a proper warning message to show something didn't go right --- youtube_dl/extractor/cbs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/cbs.py b/youtube_dl/extractor/cbs.py index 126a881fd..aee86ff47 100644 --- a/youtube_dl/extractor/cbs.py +++ b/youtube_dl/extractor/cbs.py @@ -79,10 +79,13 @@ class CBSIE(CBSBaseIE): tp_formats, tp_subtitles = self._extract_theplatform_smil( update_url_query(tp_release_url, query), content_id, 'Downloading %s SMIL data' % asset_type) + formats.extend(tp_formats) + subtitles = self._merge_subtitles(subtitles, tp_subtitles) except ExtractorError: + print("WARNING: Failed to download %s SMTL data" % asset_type) continue - formats.extend(tp_formats) - subtitles = self._merge_subtitles(subtitles, tp_subtitles) + + self._sort_formats(formats) info = self._extract_theplatform_metadata(tp_path, content_id) From d052f3510f2d67461598b24379b07f4f45ee287e Mon Sep 17 00:00:00 2001 From: Zach Knox Date: Sat, 10 Mar 2018 13:03:12 -0500 Subject: [PATCH 3/3] removed a blank line because flake8 told me to --- youtube_dl/extractor/cbs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/youtube_dl/extractor/cbs.py b/youtube_dl/extractor/cbs.py index aee86ff47..14d8568ca 100644 --- a/youtube_dl/extractor/cbs.py +++ b/youtube_dl/extractor/cbs.py @@ -85,7 +85,6 @@ class CBSIE(CBSBaseIE): print("WARNING: Failed to download %s SMTL data" % asset_type) continue - self._sort_formats(formats) info = self._extract_theplatform_metadata(tp_path, content_id)