X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fsyfy.py;h=5ca079f880717933a4216de6399046a44970d29b;hb=1e108029907ca28b75f37d2cf0bf25bcabbfbdac;hp=502d43ec462666136e403c1a6f61d5e3b26303fb;hpb=4edff78531c42aa126b02a9b792f84d2775c2172;p=youtube-dl diff --git a/youtube_dl/extractor/syfy.py b/youtube_dl/extractor/syfy.py index 502d43ec4..5ca079f88 100644 --- a/youtube_dl/extractor/syfy.py +++ b/youtube_dl/extractor/syfy.py @@ -6,9 +6,9 @@ from .common import InfoExtractor class SyfyIE(InfoExtractor): - _VALID_URL = r'https?://www\.syfy\.com/videos/.+?vid:(?P\d+)' + _VALID_URL = r'https?://www\.syfy\.com/(?:videos/.+?vid:(?P[0-9]+)|(?!videos)(?P[^/]+)(?:$|[?#]))' - _TEST = { + _TESTS = [{ 'url': 'http://www.syfy.com/videos/Robot%20Combat%20League/Behind%20the%20Scenes/vid:2631458', 'info_dict': { 'id': 'NmqMrGnXvmO1', @@ -16,15 +16,31 @@ class SyfyIE(InfoExtractor): 'title': 'George Lucas has Advice for his Daughter', 'description': 'Listen to what insights George Lucas give his daughter Amanda.', }, - 'params': { - # f4m download - 'skip_download': True, + 'add_ie': ['ThePlatform'], + }, { + 'url': 'http://www.syfy.com/wilwheaton', + 'md5': '94dfa54ee3ccb63295b276da08c415f6', + 'info_dict': { + 'id': '4yoffOOXC767', + 'ext': 'flv', + 'title': 'The Wil Wheaton Project - Premiering May 27th at 10/9c.', + 'description': 'The Wil Wheaton Project premieres May 27th at 10/9c. Don\'t miss it.', }, 'add_ie': ['ThePlatform'], - } + 'skip': 'Blocked outside the US', + }] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + video_name = mobj.group('video_name') + if video_name: + generic_webpage = self._download_webpage(url, video_name) + video_id = self._search_regex( + r'', + generic_webpage, 'video ID') + url = 'http://www.syfy.com/videos/%s/%s/vid:%s' % ( + video_name, video_name, video_id) + else: + video_id = mobj.group('id') webpage = self._download_webpage(url, video_id) return self.url_result(self._og_search_video_url(webpage))