[vh1] fix extraction(fixes #9613)
[youtube-dl] / youtube_dl / extractor / vh1.py
1 from __future__ import unicode_literals
2
3 from .mtv import MTVServicesInfoExtractor
4
5
6 class VH1IE(MTVServicesInfoExtractor):
7     IE_NAME = 'vh1.com'
8     _FEED_URL = 'http://www.vh1.com/feeds/mrss/'
9     _TESTS = [{
10         'url': 'http://www.vh1.com/episodes/0umwpq/hip-hop-squares-kent-jones-vs-nick-young-season-1-ep-120',
11         'info_dict': {
12             'title': 'Kent Jones vs. Nick Young',
13             'description': 'Come to Play. Stay to Party. With Mike Epps, TIP, O’Shea Jackson Jr., T-Pain, Tisha Campbell-Martin and more.',
14         },
15         'playlist_mincount': 4,
16     }, {
17         # Clip
18         'url': 'http://www.vh1.com/video-clips/t74mif/scared-famous-scared-famous-extended-preview',
19         'info_dict': {
20             'id': '0a50c2d2-a86b-4141-9565-911c7e2d0b92',
21             'ext': 'mp4',
22             'title': 'Scared Famous|October 9, 2017|1|NO-EPISODE#|Scared Famous + Extended Preview',
23             'description': 'md5:eff5551a274c473a29463de40f7b09da',
24             'upload_date': '20171009',
25             'timestamp': 1507574700,
26         },
27         'params': {
28             # m3u8 download
29             'skip_download': True,
30         },
31     }]
32
33     _VALID_URL = r'https?://(?:www\.)?vh1\.com/(?:video-clips|episodes)/(?P<id>[^/?#.]+)'
34
35     def _real_extract(self, url):
36         playlist_id = self._match_id(url)
37         webpage = self._download_webpage(url, playlist_id)
38         mgid = self._extract_triforce_mgid(webpage)
39         videos_info = self._get_videos_info(mgid)
40         return videos_info