aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/ultimedia.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-12-10 23:04:28 +0100
committerremitamine <remitamine@gmail.com>2015-12-10 23:04:28 +0100
commit3da3999612311ff193890072727208892b9e93f0 (patch)
treeb7e4d1ee9c76c2b9eb7d955ca3040583123c3444 /youtube_dl/extractor/ultimedia.py
parent6aeba407db84a636fc2522b4f2344eac9e0c1fdb (diff)
[ultimedia] keep direct support for ultimedia videos
Diffstat (limited to 'youtube_dl/extractor/ultimedia.py')
-rw-r--r--youtube_dl/extractor/ultimedia.py31
1 files changed, 27 insertions, 4 deletions
diff --git a/youtube_dl/extractor/ultimedia.py b/youtube_dl/extractor/ultimedia.py
index 45201332d..60328123c 100644
--- a/youtube_dl/extractor/ultimedia.py
+++ b/youtube_dl/extractor/ultimedia.py
@@ -8,10 +8,29 @@ from ..utils import int_or_none
class UltimediaIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?ultimedia\.com/deliver/(?P<type>generic|musique)(?:/[^/]+)*/(?:src|article)/(?P<id>[\d+a-z]+)'
+ _VALID_URL = r'''(?x)
+ https?://(?:www\.)?ultimedia\.com/
+ (?:
+ deliver/
+ (?P<embed_type>
+ generic|
+ musique
+ )
+ (?:/[^/]+)*/
+ (?:
+ src|
+ article
+ )|
+ default/index/video
+ (?P<site_type>
+ generic|
+ music
+ )
+ /id
+ )/(?P<id>[\d+a-z]+)'''
_TESTS = [{
# news
- 'url': 'https://www.ultimedia.com/deliver/generic/iframe/mdtk/01601930/zone/1/src/s8uk0r/autoplay/yes/ad/no/width/714/height/435',
+ 'url': 'https://www.ultimedia.com/default/index/videogeneric/id/s8uk0r',
'md5': '276a0e49de58c7e85d32b057837952a2',
'info_dict': {
'id': 's8uk0r',
@@ -25,7 +44,7 @@ class UltimediaIE(InfoExtractor):
},
}, {
# music
- 'url': 'https://www.ultimedia.com/deliver/musique/iframe/mdtk/01601930/zone/1/article/xvpfp8/autoplay/yes/ad/no/width/714/height/435',
+ 'url': 'https://www.ultimedia.com/default/index/videomusic/id/xvpfp8',
'md5': '2ea3513813cf230605c7e2ffe7eca61c',
'info_dict': {
'id': 'xvpfp8',
@@ -48,7 +67,11 @@ class UltimediaIE(InfoExtractor):
return mobj.group('url')
def _real_extract(self, url):
- video_type, video_id = re.match(self._VALID_URL, url).groups()
+ mobj = re.match(self._VALID_URL, url)
+ video_id = mobj.group('id')
+ video_type = mobj.group('embed_type') or mobj.group('site_type')
+ if video_type == 'music':
+ video_type = 'musique'
deliver_info = self._download_json(
'http://www.ultimedia.com/deliver/video?video=%s&topic=%s' % (video_id, video_type),