]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/gameinformer.py
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',
14 'id': '4515472681001',
16 'title': 'Replay - Animal Crossing',
17 'description': 'md5:2e211891b215c85d061adc7a4dd2d930',
18 'timestamp': 1443457610706,
22 'skip_download': True,
26 def _real_extract(self
, url
):
27 display_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, display_id
)
30 bc_api_url
= self
._search
_regex
(r
"getVideo\('([^']+)'", webpage
, 'brightcove api url')
31 json_data
= self
._download
_json
(
32 bc_api_url
+ '&video_fields=id,name,shortDescription,publishedDate,videoStillURL,length,IOSRenditions',
36 'id': compat_str(json_data
['id']),
37 'display_id': display_id
,
38 'url': json_data
['IOSRenditions'][0]['url'],
39 'title': json_data
['name'],
40 'description': json_data
.get('shortDescription'),
41 'timestamp': int_or_none(json_data
.get('publishedDate')),
42 'duration': int_or_none(json_data
.get('length')),