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.

41 lines
1.3 KiB

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