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