]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/charlierose.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / charlierose.py
CommitLineData
db29af6d
DR
1from .common import InfoExtractor
2from ..utils import remove_end
3
4
5class CharlieRoseIE(InfoExtractor):
5b4bfbfc 6 _VALID_URL = r'https?://(?:www\.)?charlierose\.com/(?:video|episode)(?:s|/player)/(?P<id>\d+)'
52665672 7 _TESTS = [{
db29af6d 8 'url': 'https://charlierose.com/videos/27996',
52665672 9 'md5': 'fda41d49e67d4ce7c2411fd2c4702e09',
db29af6d
DR
10 'info_dict': {
11 'id': '27996',
12 'ext': 'mp4',
13 'title': 'Remembering Zaha Hadid',
ec85ded8 14 'thumbnail': r're:^https?://.*\.jpg\?\d+',
db29af6d 15 'description': 'We revisit past conversations with Zaha Hadid, in memory of the world renowned Iraqi architect.',
52665672
YCH
16 'subtitles': {
17 'en': [{
18 'ext': 'vtt',
19 }],
20 },
db29af6d 21 },
52665672
YCH
22 }, {
23 'url': 'https://charlierose.com/videos/27996',
24 'only_matching': True,
5b4bfbfc
S
25 }, {
26 'url': 'https://charlierose.com/episodes/30887?autoplay=true',
27 'only_matching': True,
52665672 28 }]
db29af6d
DR
29
30 _PLAYER_BASE = 'https://charlierose.com/video/player/%s'
31
32 def _real_extract(self, url):
33 video_id = self._match_id(url)
34 webpage = self._download_webpage(self._PLAYER_BASE % video_id, video_id)
35
36 title = remove_end(self._og_search_title(webpage), ' - Charlie Rose')
37
52665672 38 info_dict = self._parse_html5_media_entries(
ad120ae1
YCH
39 self._PLAYER_BASE % video_id, webpage, video_id,
40 m3u8_entry_protocol='m3u8_native')[0]
52665672 41 self._remove_duplicate_formats(info_dict['formats'])
db29af6d 42
52665672 43 info_dict.update({
db29af6d
DR
44 'id': video_id,
45 'title': title,
db29af6d
DR
46 'thumbnail': self._og_search_thumbnail(webpage),
47 'description': self._og_search_description(webpage),
52665672
YCH
48 })
49
50 return info_dict