Ozzy Walsh a0f285fce1 Change Spike _VALID_URL to Paramount Network URL #15418
Downloads from Paramount Network(previously Spike) now function and no
longer raise 'Unsupported URL'.

Single episodes seem to be download in parts as described in #15418,
which may no be correct behaviour
2018-01-25 09:39:07 +00:00

43 lines
1.7 KiB
Python

from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
class SpikeIE(MTVServicesInfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?paramountnetwork\.com/[^/]+/[\da-z]{6}(?:[/?#&]|$)'
_TESTS = [{
'url': 'http://www.paramountnetwork.com/video-clips/e1ktem/nobodies-gangbanged',
'md5': 'f53ab001b5c1c6fee01bc9f00e2859d1',
'info_dict': {
'id': 'e1ktem',
'ext': 'mp4',
'title': 'Gangbanged - NOBODIES | Paramount Network',
'description': 'TODO: Add description checksum',
'upload_date': 'TODO: Add upload date',
},
}, {
'url': 'http://www.paramountnetwork.com/episodes/j830qm/lip-sync-battle-joel-mchale-vs-jim-rash-season-2-ep-13',
'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
'info_dict': {
'id': 'j830qm',
'ext': 'mp4',
'title': 'Lip Sync Battle - Season 2, Ep. 13 - Joel McHale Vs. Jim Rash - Full Episode | Paramount Network',
'description': 'TODO: Add description checksum',
},
}]
_FEED_URL = 'http://www.spike.com/feeds/mrss/'
_MOBILE_TEMPLATE = 'http://m.spike.com/videos/video.rbml?id=%s'
_CUSTOM_URL_REGEX = re.compile(r'spikenetworkapp://([^/]+/[-a-fA-F0-9]+)')
_GEO_COUNTRIES = ['US']
def _extract_mgid(self, webpage):
mgid = super(SpikeIE, self)._extract_mgid(webpage)
if mgid is None:
url_parts = self._search_regex(self._CUSTOM_URL_REGEX, webpage, 'episode_id')
video_type, episode_id = url_parts.split('/', 1)
mgid = 'mgid:arc:{0}:spike.com:{1}'.format(video_type, episode_id)
return mgid