]>
Commit | Line | Data |
---|---|---|
1 | from .common import InfoExtractor | |
2 | from ..utils import ( | |
3 | clean_html, | |
4 | get_element_by_class, | |
5 | js_to_json, | |
6 | ) | |
7 | ||
8 | ||
9 | class TVNoeIE(InfoExtractor): | |
10 | _VALID_URL = r'https?://(?:www\.)?tvnoe\.cz/video/(?P<id>[0-9]+)' | |
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', | |
18 | 'title': 'prof. Tomáš Halík, Th.D. - Návrat náboženství a střet civilizací', | |
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 | ||
27 | iframe_url = self._search_regex( | |
28 | r'<iframe[^>]+src="([^"]+)"', webpage, 'iframe URL') | |
29 | ||
30 | ifs_page = self._download_webpage(iframe_url, video_id) | |
31 | jwplayer_data = self._find_jwplayer_data( | |
32 | ifs_page, video_id, transform_source=js_to_json) | |
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, | |
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)), | |
42 | 'series': clean_html(get_element_by_class('title', webpage)) | |
43 | }) | |
44 | ||
45 | return info_dict |