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