]>
Commit | Line | Data |
---|---|---|
4e7f375c DP |
1 | from .common import InfoExtractor |
2 | from ..utils import extract_attributes, remove_end | |
3 | ||
4 | ||
5 | class TheHoleTvIE(InfoExtractor): | |
6 | _VALID_URL = r'https?://(?:www\.)?the-hole\.tv/episodes/(?P<id>[\w-]+)' | |
7 | _TESTS = [{ | |
8 | 'url': 'https://the-hole.tv/episodes/gromkii-vopros-sergey-orlov', | |
9 | 'md5': 'fea6682f47786f3ae5a6cbd635ec4bf9', | |
10 | 'info_dict': { | |
11 | 'id': 'gromkii-vopros-sergey-orlov', | |
12 | 'ext': 'mp4', | |
13 | 'title': 'Сергей Орлов — Громкий вопрос', | |
14 | 'thumbnail': 'https://assets-cdn.the-hole.tv/images/t8gan4n6zn627e7wni11b2uemqts', | |
15 | 'description': 'md5:45741a9202331f995d9fb76996759379' | |
16 | } | |
17 | }] | |
18 | ||
19 | def _real_extract(self, url): | |
20 | video_id = self._match_id(url) | |
21 | webpage = self._download_webpage(url, video_id) | |
22 | ||
23 | player_attrs = extract_attributes(self._search_regex( | |
24 | r'(<div[^>]*\bdata-controller="player"[^>]*>)', webpage, 'video player')) | |
25 | formats, subtitles = self._extract_m3u8_formats_and_subtitles( | |
26 | player_attrs['data-player-source-value'], video_id, 'mp4') | |
27 | self._sort_formats(formats) | |
28 | ||
29 | return { | |
30 | 'id': video_id, | |
31 | 'title': remove_end(self._html_extract_title(webpage), ' — The Hole'), | |
32 | 'description': self._og_search_description(webpage), | |
33 | 'thumbnail': player_attrs.get('data-player-poster-value'), | |
34 | 'formats': formats, | |
35 | 'subtitles': subtitles | |
36 | } |