You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3 KiB

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