1 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class GamekingsIE(InfoExtractor):
9 _VALID_URL = r'http://www\.gamekings\.tv/videos/(?P<name>[0-9a-z\-]+)'
12 'url': 'http://www.gamekings.tv/videos/phoenix-wright-ace-attorney-dual-destinies-review/',
13 # MD5 is flaky, seems to change regularly
14 # 'md5': '2f32b1f7b80fdc5cb616efb4f387f8a3',
18 'title': 'Phoenix Wright: Ace Attorney \u2013 Dual Destinies Review',
19 'description': 'md5:36fd701e57e8c15ac8682a2374c99731',
23 'url': 'http://www.gamekings.tv/videos/the-legend-of-zelda-majoras-mask/',
27 'title': 'The Legend of Zelda: Majora’s Mask'
32 def _real_extract(self, url):
34 mobj = re.match(self._VALID_URL, url)
35 name = mobj.group('name')
36 webpage = self._download_webpage(url, name)
37 video_url = self._og_search_video_url(webpage)
39 video = re.search(r'[0-9]+', video_url)
40 video_id = video.group(0)
42 # Todo: add medium format
43 video_url = video_url.replace(video_id, 'large/' + video_id)
44 if not (self._is_valid_url(video_url, video_id)):
45 video_url = video_url.replace('large/' + video_id, video_id)
46 video_url = video_url.replace('http://stream.gamekings.tv/', '')
52 'title': self._og_search_title(webpage),
53 'description': self._og_search_description(webpage),