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