diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-09-12 13:14:44 +0200 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-09-12 13:14:44 +0200 |
commit | 6a19bfa390150fde01f5e865605114344ab68409 (patch) | |
tree | d87e9c55f031b529d6a6c2ca1a1e680407800f52 /youtube_dl/extractor/arte.py | |
parent | 57e25a9c8a4791a370af77a3529d15c958eae4b3 (diff) | |
parent | 2f483758bc6a6661f1215c38161ee626d90ab655 (diff) | |
download | youtube-dl-6a19bfa390150fde01f5e865605114344ab68409.zip youtube-dl-6a19bfa390150fde01f5e865605114344ab68409.tar.gz youtube-dl-6a19bfa390150fde01f5e865605114344ab68409.tar.bz2 |
Merge branch 'upstream'
Diffstat (limited to 'youtube_dl/extractor/arte.py')
-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 56baef2..5cde90c 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: + 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) |