1 from .common
import InfoExtractor
8 class MastersIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?masters\.com/en_US/watch/(?P<date>\d{4}-\d{2}-\d{2})/(?P<id>\d+)'
11 'url': 'https://www.masters.com/en_US/watch/2022-04-07/16493755593805191/sungjae_im_thursday_interview_2022.html',
13 'id': '16493755593805191',
15 'title': 'Sungjae Im: Thursday Interview 2022',
16 'upload_date': '20220407',
17 'thumbnail': r
're:^https?://.*\.jpg$',
21 def _real_extract(self
, url
):
22 video_id
, upload_date
= self
._match
_valid
_url
(url
).group('id', 'date')
23 content_resp
= self
._download
_json
(
24 f
'https://www.masters.com/relatedcontent/rest/v2/masters_v1/en/content/masters_v1_{video_id}_en',
26 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(traverse_obj(content_resp
, ('media', 'm3u8')), video_id
, 'mp4')
28 thumbnails
= [{'id': name
, 'url': url
} for name
, url
in traverse_obj(content_resp
, ('images', 0), default
={}).items()]
32 'title': content_resp
.get('title'),
34 'subtitles': subtitles
,
35 'upload_date': unified_strdate(upload_date
),
36 'thumbnails': thumbnails
,