2 from __future__ import unicode_literals
4 from .common import InfoExtractor
9 from .youtube import YoutubeIE
12 class GamekingsIE(InfoExtractor):
13 _VALID_URL = r'http://www\.gamekings\.nl/(?:videos|nieuws)/(?P<id>[^/]+)'
16 'url': 'http://www.gamekings.nl/videos/phoenix-wright-ace-attorney-dual-destinies-review/',
17 'md5': '5208d3a17adeaef829a7861887cb9029',
21 'title': 'Phoenix Wright: Ace Attorney - Dual Destinies Review',
22 'description': 'md5:db88c0e7f47e9ea50df3271b9dc72e1d',
23 'thumbnail': 're:^https?://.*\.jpg$',
24 'uploader_id': 'UCJugRGo4STYMeFr5RoOShtQ',
25 'uploader': 'Gamekings Vault',
26 'upload_date': '20151123',
28 'add_ie': ['Youtube'],
31 'url': 'http://www.gamekings.nl/videos/the-legend-of-zelda-majoras-mask/',
32 'md5': '12bf04dfd238e70058046937657ea68d',
34 'id': 'the-legend-of-zelda-majoras-mask',
36 'title': 'The Legend of Zelda: Majora’s Mask',
37 'description': 'md5:9917825fe0e9f4057601fe1e38860de3',
38 'thumbnail': 're:^https?://.*\.jpg$',
41 'url': 'http://www.gamekings.nl/nieuws/gamekings-extra-shelly-en-david-bereiden-zich-voor-op-de-livestream/',
42 'only_matching': True,
45 def _real_extract(self, url):
46 video_id = self._match_id(url)
48 webpage = self._download_webpage(url, video_id)
50 playlist_id = self._search_regex(
51 r'gogoVideo\([^,]+,\s*"([^"]+)', webpage, 'playlist id')
53 # Check if a YouTube embed is used
54 if YoutubeIE.suitable(playlist_id):
55 return self.url_result(playlist_id, ie='Youtube')
57 playlist = self._download_xml(
58 'http://www.gamekings.tv/wp-content/themes/gk2010/rss_playlist.php?id=%s' % playlist_id,
62 'jwplayer': 'http://rss.jwpcdn.com/'
65 item = playlist.find('./channel/item')
67 thumbnail = xpath_text(item, xpath_with_ns('./jwplayer:image', NS_MAP), 'thumbnail')
68 video_url = item.find(xpath_with_ns('./jwplayer:source', NS_MAP)).get('file')
73 'title': self._og_search_title(webpage),
74 'description': self._og_search_description(webpage),
75 'thumbnail': thumbnail,