diff options
author | Sergey M․ <[email protected]> | 2017-08-18 00:58:23 +0700 |
---|---|---|
committer | Sergey M․ <[email protected]> | 2017-08-18 00:58:23 +0700 |
commit | c0892b2b465cff95d392eaa725e39bd47e4dff58 (patch) | |
tree | 26e719b75d2af91b28bc6ae39095954163242f64 | |
parent | a5ac0c475589fd1dcd3ba04802f28828c24be6c9 (diff) | |
download | youtube-dl-c0892b2b465cff95d392eaa725e39bd47e4dff58.tar.gz youtube-dl-c0892b2b465cff95d392eaa725e39bd47e4dff58.zip |
[arte] Detect unavailable videos (closes #13945)
-rw-r--r-- | youtube_dl/extractor/arte.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py index 56baef29d..02613cf5d 100644 --- a/youtube_dl/extractor/arte.py +++ b/youtube_dl/extractor/arte.py @@ -9,12 +9,13 @@ from ..compat import ( compat_urllib_parse_urlparse, ) from ..utils import ( + ExtractorError, find_xpath_attr, - unified_strdate, get_element_by_attribute, int_or_none, NO_DEFAULT, qualities, + unified_strdate, ) # There are different sources of video in arte.tv, the extraction process @@ -79,6 +80,13 @@ class ArteTVBaseIE(InfoExtractor): info = self._download_json(json_url, video_id) player_info = info['videoJsonPlayer'] + vsr = player_info['VSR'] + + if not vsr and not player_info.get('VRU'): + raise ExtractorError( + 'Video %s is not available' % player_info.get('VID') or video_id, + expected=True) + upload_date_str = player_info.get('shootingDate') if not upload_date_str: upload_date_str = (player_info.get('VRA') or player_info.get('VDA') or '').split(' ')[0] @@ -107,7 +115,7 @@ class ArteTVBaseIE(InfoExtractor): langcode = LANGS.get(lang, lang) formats = [] - for format_id, format_dict in player_info['VSR'].items(): + for format_id, format_dict in vsr.items(): f = dict(format_dict) versionCode = f.get('versionCode') l = re.escape(langcode) |