]> git.bitcoin.ninja Git - youtube-dl/blob - youtube_dl/extractor/spike.py
[facebook] Add support for DASH manifests
[youtube-dl] / youtube_dl / extractor / spike.py
1 from __future__ import unicode_literals
2
3 from .mtv import MTVServicesInfoExtractor
4
5
6 class SpikeIE(MTVServicesInfoExtractor):
7     _VALID_URL = r'''(?x)https?://
8         (?:www\.spike\.com/(?:video-(?:clips|playlists)|(?:full-)?episodes)/.+|
9          m\.spike\.com/videos/video\.rbml\?id=(?P<id>[^&]+))
10         '''
11     _TEST = {
12         'url': 'http://www.spike.com/video-clips/lhtu8m/auction-hunters-can-allen-ride-a-hundred-year-old-motorcycle',
13         'md5': '1a9265f32b0c375793d6c4ce45255256',
14         'info_dict': {
15             'id': 'b9c8221a-4e50-479a-b86d-3333323e38ba',
16             'ext': 'mp4',
17             'title': 'Auction Hunters|Can Allen Ride A Hundred Year-Old Motorcycle?',
18             'description': 'md5:fbed7e82ed5fad493615b3094a9499cb',
19         },
20     }
21
22     _FEED_URL = 'http://www.spike.com/feeds/mrss/'
23     _MOBILE_TEMPLATE = 'http://m.spike.com/videos/video.rbml?id=%s'
24
25     def _real_extract(self, url):
26         mobile_id = self._match_id(url)
27         if mobile_id:
28             url = 'http://www.spike.com/video-clips/%s' % mobile_id
29         return super(SpikeIE, self)._real_extract(url)