[ie/wistia] Support password-protected videos (#11100)
[yt-dlp3.git] / yt_dlp / extractor / oktoberfesttv.py
blobb4bcdc74178f986bace085be9b41af2f1337bcac
1 from .common import InfoExtractor
4 class OktoberfestTVIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?oktoberfest-tv\.de/[^/]+/[^/]+/video/(?P<id>[^/?#]+)'
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}$',
13 'thumbnail': r're:^https?://.*\.jpg$',
14 'is_live': True,
16 'params': {
17 'skip_download': True,
21 def _real_extract(self, url):
22 video_id = self._match_id(url)
23 webpage = self._download_webpage(url, video_id)
25 title = self._html_search_regex(
26 r'<h1><strong>.*?</strong>(.*?)</h1>', webpage, 'title')
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)
37 return {
38 'id': video_id,
39 'title': title,
40 'url': video_url,
41 'ext': 'mp4',
42 'is_live': True,
43 'thumbnail': thumbnail,