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