]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/oktoberfesttv.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / oktoberfesttv.py
CommitLineData
394599f4
PH
1from .common import InfoExtractor
2
3
4class OktoberfestTVIE(InfoExtractor):
92519402 5 _VALID_URL = r'https?://(?:www\.)?oktoberfest-tv\.de/[^/]+/[^/]+/video/(?P<id>[^/?#]+)'
394599f4
PH
6
7 _TEST = {
8 'url': 'http://www.oktoberfest-tv.de/de/kameras/video/hb-zelt',
9 'info_dict': {
10 'id': 'hb-zelt',
11 'ext': 'mp4',
12 'title': 're:^Live-Kamera: Hofbräuzelt [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
ec85ded8 13 'thumbnail': r're:^https?://.*\.jpg$',
394599f4
PH
14 'is_live': True,
15 },
16 'params': {
17 'skip_download': True,
add96eb9 18 },
394599f4
PH
19 }
20
21 def _real_extract(self, url):
22 video_id = self._match_id(url)
23 webpage = self._download_webpage(url, video_id)
24
39ca3b5c 25 title = self._html_search_regex(
26 r'<h1><strong>.*?</strong>(.*?)</h1>', webpage, 'title')
394599f4
PH
27
28 clip = self._search_regex(
29 r"clip:\s*\{\s*url:\s*'([^']+)'", webpage, 'clip')
30 ncurl = self._search_regex(
31 r"netConnectionUrl:\s*'([^']+)'", webpage, 'rtmp base')
32 video_url = ncurl + clip
33 thumbnail = self._search_regex(
34 r"canvas:\s*\{\s*backgroundImage:\s*'url\(([^)]+)\)'", webpage,
35 'thumbnail', fatal=False)
36
37 return {
38 'id': video_id,
39 'title': title,
40 'url': video_url,
41 'ext': 'mp4',
42 'is_live': True,
43 'thumbnail': thumbnail,
44 }