]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/tvnoe.py
[ie/orf:on] Improve extraction (#9677)
[yt-dlp.git] / yt_dlp / extractor / tvnoe.py
CommitLineData
a4a554a7 1from .common import InfoExtractor
9127e153
YCH
2from ..utils import (
3 clean_html,
4 get_element_by_class,
5 js_to_json,
6)
78e762d2
MC
7
8
a4a554a7 9class TVNoeIE(InfoExtractor):
df773c3d 10 _WORKING = False
6cfcb8ac 11 _VALID_URL = r'https?://(?:www\.)?tvnoe\.cz/video/(?P<id>[0-9]+)'
78e762d2
MC
12 _TEST = {
13 'url': 'http://www.tvnoe.cz/video/10362',
14 'md5': 'aee983f279aab96ec45ab6e2abb3c2ca',
15 'info_dict': {
16 'id': '10362',
17 'ext': 'mp4',
18 'series': 'Noční univerzita',
9127e153 19 'title': 'prof. Tomáš Halík, Th.D. - Návrat náboženství a střet civilizací',
78e762d2
MC
20 'description': 'md5:f337bae384e1a531a52c55ebc50fff41',
21 }
22 }
23
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
26 webpage = self._download_webpage(url, video_id)
27
9127e153
YCH
28 iframe_url = self._search_regex(
29 r'<iframe[^>]+src="([^"]+)"', webpage, 'iframe URL')
78e762d2
MC
30
31 ifs_page = self._download_webpage(iframe_url, video_id)
c73e330e
RU
32 jwplayer_data = self._find_jwplayer_data(
33 ifs_page, video_id, transform_source=js_to_json)
78e762d2
MC
34 info_dict = self._parse_jwplayer_data(
35 jwplayer_data, video_id, require_title=False, base_url=iframe_url)
36
37 info_dict.update({
38 'id': video_id,
9127e153
YCH
39 'title': clean_html(get_element_by_class(
40 'field-name-field-podnazev', webpage)),
41 'description': clean_html(get_element_by_class(
42 'field-name-body', webpage)),
78e762d2
MC
43 'series': clean_html(get_element_by_class('title', webpage))
44 })
9127e153 45
78e762d2 46 return info_dict