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