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.

28 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class GameInformerIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?gameinformer\.com/(?:[^/]+/)*(?P<id>.+)\.aspx'
  6. _TEST = {
  7. 'url': 'http://www.gameinformer.com/b/features/archive/2015/09/26/replay-animal-crossing.aspx',
  8. 'md5': '292f26da1ab4beb4c9099f1304d2b071',
  9. 'info_dict': {
  10. 'id': '4515472681001',
  11. 'ext': 'mp4',
  12. 'title': 'Replay - Animal Crossing',
  13. 'description': 'md5:2e211891b215c85d061adc7a4dd2d930',
  14. 'timestamp': 1443457610,
  15. 'upload_date': '20150928',
  16. 'uploader_id': '694940074001',
  17. },
  18. }
  19. BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/694940074001/default_default/index.html?videoId=%s'
  20. def _real_extract(self, url):
  21. display_id = self._match_id(url)
  22. webpage = self._download_webpage(url, display_id)
  23. brightcove_id = self._search_regex(r"getVideo\('[^']+video_id=(\d+)", webpage, 'brightcove id')
  24. return self.url_result(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, 'BrightcoveNew', brightcove_id)