]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/theholetv.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / theholetv.py
CommitLineData
4e7f375c
DP
1from .common import InfoExtractor
2from ..utils import extract_attributes, remove_end
3
4
5class 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',
add96eb9 15 'description': 'md5:45741a9202331f995d9fb76996759379',
16 },
4e7f375c
DP
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')
4e7f375c
DP
27
28 return {
29 'id': video_id,
30 'title': remove_end(self._html_extract_title(webpage), ' — The Hole'),
31 'description': self._og_search_description(webpage),
32 'thumbnail': player_attrs.get('data-player-poster-value'),
33 'formats': formats,
add96eb9 34 'subtitles': subtitles,
4e7f375c 35 }