]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rockstargames.py
1 from .common
import InfoExtractor
8 class RockstarGamesIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?rockstargames\.com/videos(?:/video/|#?/?\?.*\bvideo=)(?P<id>\d+)'
11 'url': 'https://www.rockstargames.com/videos/video/11544/',
12 'md5': '03b5caa6e357a4bd50e3143fc03e5733',
16 'title': 'Further Adventures in Finance and Felony Trailer',
17 'description': 'md5:6d31f55f30cb101b5476c4a379e324a3',
18 'thumbnail': r
're:^https?://.*\.jpg$',
19 'timestamp': 1464876000,
20 'upload_date': '20160602',
23 'url': 'http://www.rockstargames.com/videos#/?video=48',
24 'only_matching': True,
27 def _real_extract(self
, url
):
28 video_id
= self
._match
_id
(url
)
30 video
= self
._download
_json
(
31 'https://www.rockstargames.com/videoplayer/videos/get-video.json',
37 title
= video
['title']
40 for video
in video
['files_processed']['video/mp4']:
41 if not video
.get('src'):
43 resolution
= video
.get('resolution')
44 height
= int_or_none(self
._search
_regex
(
45 r
'^(\d+)[pP]$', resolution
or '', 'height', default
=None))
47 'url': self
._proto
_relative
_url
(video
['src']),
48 'format_id': resolution
,
53 youtube_id
= video
.get('youtube_id')
55 return self
.url_result(youtube_id
, 'Youtube')
60 'description': video
.get('description'),
61 'thumbnail': self
._proto
_relative
_url
(video
.get('screencap')),
62 'timestamp': parse_iso8601(video
.get('created')),