1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-15 09:11:22 +01:00
youtube-dl/youtube_dl/extractor/vh1.py

42 lines
1.5 KiB
Python
Raw Normal View History

2017-10-12 06:02:26 +02:00
# coding: utf-8
2014-06-07 16:39:08 +02:00
from __future__ import unicode_literals
2017-10-11 22:51:57 +02:00
from .mtv import MTVServicesInfoExtractor
2014-06-07 16:39:08 +02:00
2014-05-17 00:15:02 +02:00
2017-10-11 22:51:57 +02:00
class VH1IE(MTVServicesInfoExtractor):
2014-06-07 16:39:08 +02:00
IE_NAME = 'vh1.com'
2017-10-11 22:51:57 +02:00
_FEED_URL = 'http://www.vh1.com/feeds/mrss/'
2014-06-07 16:39:08 +02:00
_TESTS = [{
2017-10-11 22:51:57 +02:00
'url': 'http://www.vh1.com/episodes/0umwpq/hip-hop-squares-kent-jones-vs-nick-young-season-1-ep-120',
2014-06-07 16:39:08 +02:00
'info_dict': {
2017-10-11 22:51:57 +02:00
'title': 'Kent Jones vs. Nick Young',
'description': 'Come to Play. Stay to Party. With Mike Epps, TIP, OShea Jackson Jr., T-Pain, Tisha Campbell-Martin and more.',
},
2017-10-11 22:51:57 +02:00
'playlist_mincount': 4,
2014-06-07 16:39:08 +02:00
}, {
2017-10-11 22:51:57 +02:00
# Clip
'url': 'http://www.vh1.com/video-clips/t74mif/scared-famous-scared-famous-extended-preview',
2014-06-07 16:39:08 +02:00
'info_dict': {
2017-10-11 22:51:57 +02:00
'id': '0a50c2d2-a86b-4141-9565-911c7e2d0b92',
2014-06-07 16:39:08 +02:00
'ext': 'mp4',
2017-10-11 22:51:57 +02:00
'title': 'Scared Famous|October 9, 2017|1|NO-EPISODE#|Scared Famous + Extended Preview',
'description': 'md5:eff5551a274c473a29463de40f7b09da',
'upload_date': '20171009',
'timestamp': 1507574700,
},
2017-10-11 22:51:57 +02:00
'params': {
# m3u8 download
'skip_download': True,
},
2014-06-07 16:39:08 +02:00
}]
2017-10-11 22:51:57 +02:00
_VALID_URL = r'https?://(?:www\.)?vh1\.com/(?:video-clips|episodes)/(?P<id>[^/?#.]+)'
2014-05-17 00:15:02 +02:00
def _real_extract(self, url):
2017-10-11 22:51:57 +02:00
playlist_id = self._match_id(url)
webpage = self._download_webpage(url, playlist_id)
mgid = self._extract_triforce_mgid(webpage)
videos_info = self._get_videos_info(mgid)
return videos_info