2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class RockstarGamesIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?rockstargames\.com/videos/video/(?P<id>[0-9]+)'
14 'url': 'https://www.rockstargames.com/videos/video/11544/',
15 'md5': '03b5caa6e357a4bd50e3143fc03e5733',
19 'title': 'Further Adventures in Finance and Felony Trailer',
20 'thumbnail': 're:^https?://.*\.jpg$',
21 'description': 'md5:6d31f55f30cb101b5476c4a379e324a3',
22 'upload_date': '20160602',
23 'timestamp': 1464876000
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
29 json_data = self._download_json(
30 'https://www.rockstargames.com/videoplayer/videos/get-video.json?id=%s&locale=en_us' % video_id,
36 for video in json_data['files_processed']['video/mp4']:
37 if not video.get('src'):
39 height = video.get('resolution', '').replace('p', '')
42 'url': self._proto_relative_url(video['src']),
43 'height': int(height) if height.isdigit() else -1,
45 self._sort_formats(formats)
49 'title': json_data['title'],
50 'description': json_data.get('description'),
52 'thumbnail': self._proto_relative_url(json_data.get('screencap')),
53 'timestamp': parse_iso8601(json_data.get('created'))