2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..compat import compat_str
6 from ..utils import int_or_none
9 class GameInformerIE(InfoExtractor):
10 _VALID_URL = r'https?://(?:www\.)?gameinformer\.com/(?:[^/]+/)*(?P<id>.+)\.aspx'
12 'url': 'http://www.gameinformer.com/b/features/archive/2015/09/26/replay-animal-crossing.aspx',
13 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
15 'id': '4515472681001',
17 'title': 'Replay - Animal Crossing',
18 'description': 'md5:2e211891b215c85d061adc7a4dd2d930',
19 'timestamp': 1443457610706,
23 'skip_download': True,
27 def _real_extract(self, url):
28 display_id = self._match_id(url)
29 webpage = self._download_webpage(url, display_id)
31 bc_api_url = self._search_regex(r"getVideo\('([^']+)'", webpage, 'brightcove api url')
32 json_data = self._download_json(bc_api_url + '&video_fields=id,name,shortDescription,publishedDate,videoStillURL,length,IOSRenditions', display_id)
35 'id': compat_str(json_data['id']),
36 'display_id': display_id,
37 'url': json_data['IOSRenditions'][0]['url'],
38 'title': json_data['name'],
39 'description': json_data.get('shortDescription'),
40 'timestamp': int_or_none(json_data.get('publishedDate')),
41 'duration': int_or_none(json_data.get('length')),