projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some regexes
[youtube-dl]
/
youtube_dl
/
extractor
/
arte.py
diff --git
a/youtube_dl/extractor/arte.py
b/youtube_dl/extractor/arte.py
index 21d336ca702ac4223a52722cab46898f42a3ac78..5cde90c5b23d1f92a7709c766102bb298e63cadb 100644
(file)
--- 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 (
compat_urllib_parse_urlparse,
)
from ..utils import (
+ ExtractorError,
find_xpath_attr,
find_xpath_attr,
- unified_strdate,
get_element_by_attribute,
int_or_none,
NO_DEFAULT,
qualities,
get_element_by_attribute,
int_or_none,
NO_DEFAULT,
qualities,
+ unified_strdate,
)
# There are different sources of video in arte.tv, the extraction process
)
# 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']
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]
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 = []
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)
f = dict(format_dict)
versionCode = f.get('versionCode')
l = re.escape(langcode)
@@
-180,7
+188,7
@@
class ArteTVBaseIE(InfoExtractor):
class ArteTVPlus7IE(ArteTVBaseIE):
IE_NAME = 'arte.tv:+7'
class ArteTVPlus7IE(ArteTVBaseIE):
IE_NAME = 'arte.tv:+7'
- _VALID_URL = r'https?://(?:(?:www|sites)\.)?arte\.tv/
[^/]+/(?P<lang>fr|de|en|es)/
(?:[^/]+/)*(?P<id>[^/?#&]+)'
+ _VALID_URL = r'https?://(?:(?:www|sites)\.)?arte\.tv/
(?:[^/]+/)?(?P<lang>fr|de|en|es)/(?:videos/)?
(?:[^/]+/)*(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'http://www.arte.tv/guide/de/sendungen/XEN/xenius/?vid=055918-015_PLUS7-D',
_TESTS = [{
'url': 'http://www.arte.tv/guide/de/sendungen/XEN/xenius/?vid=055918-015_PLUS7-D',
@@
-188,6
+196,9
@@
class ArteTVPlus7IE(ArteTVBaseIE):
}, {
'url': 'http://sites.arte.tv/karambolage/de/video/karambolage-22',
'only_matching': True,
}, {
'url': 'http://sites.arte.tv/karambolage/de/video/karambolage-22',
'only_matching': True,
+ }, {
+ 'url': 'http://www.arte.tv/de/videos/048696-000-A/der-kluge-bauch-unser-zweites-gehirn',
+ 'only_matching': True,
}]
@classmethod
}]
@classmethod
@@
-408,15
+419,15
@@
class ArteTVEmbedIE(ArteTVPlus7IE):
lang = mobj.group('lang')
json_url = mobj.group('json_url')
return self._extract_from_json_url(json_url, video_id, lang)
lang = mobj.group('lang')
json_url = mobj.group('json_url')
return self._extract_from_json_url(json_url, video_id, lang)
-
-
-class
ArteTV
OperaPlatformIE(ArteTVPlus7IE):
- IE_NAME = '
arte.tv:
operaplatform'
- _VALID_URL = r'https?://
www.theoperaplatform
.eu/(?P<lang>fr|de|en|es)/(?P<id>[^/?#&]+)'
+
+
+class
The
OperaPlatformIE(ArteTVPlus7IE):
+ IE_NAME = '
the
operaplatform'
+ _VALID_URL = r'https?://
(?:www\.)?theoperaplatform\
.eu/(?P<lang>fr|de|en|es)/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'http://www.theoperaplatform.eu/de/opera/verdi-otello',
_TESTS = [{
'url': 'http://www.theoperaplatform.eu/de/opera/verdi-otello',
- 'md5': '
80f5d3fc97957b5dbfc1ddfde93b8098
',
+ 'md5': '
970655901fa2e82e04c00b955e9afe7b
',
'info_dict': {
'id': '060338-009-A',
'ext': 'mp4',
'info_dict': {
'id': '060338-009-A',
'ext': 'mp4',