1 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class SyfyIE(InfoExtractor):
9 _VALID_URL = r'https?://www\.syfy\.com/(?:videos/.+?vid:(?P<id>[0-9]+)|(?!videos)(?P<video_name>[^/]+)(?:$|[?#]))'
12 'url': 'http://www.syfy.com/videos/Robot%20Combat%20League/Behind%20the%20Scenes/vid:2631458',
16 'title': 'George Lucas has Advice for his Daughter',
17 'description': 'Listen to what insights George Lucas give his daughter Amanda.',
19 'add_ie': ['ThePlatform'],
21 'url': 'http://www.syfy.com/wilwheaton',
22 'md5': '94dfa54ee3ccb63295b276da08c415f6',
26 'title': 'The Wil Wheaton Project - Premiering May 27th at 10/9c.',
27 'description': 'The Wil Wheaton Project premieres May 27th at 10/9c. Don\'t miss it.',
29 'add_ie': ['ThePlatform'],
30 'skip': 'Blocked outside the US',
33 def _real_extract(self, url):
34 mobj = re.match(self._VALID_URL, url)
35 video_name = mobj.group('video_name')
37 generic_webpage = self._download_webpage(url, video_name)
38 video_id = self._search_regex(
39 r'<iframe.*?class="video_iframe_page"\s+src="/_utils/video/thP_video_controller.php.*?_vid([0-9]+)">',
40 generic_webpage, 'video ID')
41 url = 'http://www.syfy.com/videos/%s/%s/vid:%s' % (
42 video_name, video_name, video_id)
44 video_id = mobj.group('id')
45 webpage = self._download_webpage(url, video_id)
46 return self.url_result(self._og_search_video_url(webpage))