]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/gamekings.py
Merge tag 'upstream/2014.02.17'
[youtubedl] / youtube_dl / extractor / gamekings.py
1 import re
2
3 from .common import InfoExtractor
4
5
6 class GamekingsIE(InfoExtractor):
7 _VALID_URL = r'http://www\.gamekings\.tv/videos/(?P<name>[0-9a-z\-]+)'
8 _TEST = {
9 u"url": u"http://www.gamekings.tv/videos/phoenix-wright-ace-attorney-dual-destinies-review/",
10 u'file': u'20130811.mp4',
11 # MD5 is flaky, seems to change regularly
12 #u'md5': u'2f32b1f7b80fdc5cb616efb4f387f8a3',
13 u'info_dict': {
14 u"title": u"Phoenix Wright: Ace Attorney \u2013 Dual Destinies Review",
15 u"description": u"Melle en Steven hebben voor de review een week in de rechtbank doorbracht met Phoenix Wright: Ace Attorney - Dual Destinies.",
16 }
17 }
18
19 def _real_extract(self, url):
20
21 mobj = re.match(self._VALID_URL, url)
22 name = mobj.group('name')
23 webpage = self._download_webpage(url, name)
24 video_url = self._og_search_video_url(webpage)
25
26 video = re.search(r'[0-9]+', video_url)
27 video_id = video.group(0)
28
29 # Todo: add medium format
30 video_url = video_url.replace(video_id, 'large/' + video_id)
31
32 return {
33 'id': video_id,
34 'ext': 'mp4',
35 'url': video_url,
36 'title': self._og_search_title(webpage),
37 'description': self._og_search_description(webpage),
38 }