[cleanup] Make more playlist entries lazy (#11763)
[yt-dlp.git] / yt_dlp / extractor / theholetv.py
bloba3a7024288eb2caa0016db3162b96497d264e42d
1 from .common import InfoExtractor
2 from ..utils import extract_attributes, remove_end
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',
19 def _real_extract(self, url):
20 video_id = self._match_id(url)
21 webpage = self._download_webpage(url, video_id)
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')
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,
34 'subtitles': subtitles,