]>
Commit | Line | Data |
---|---|---|
91d54e9b H |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class VolejTVIE(InfoExtractor): | |
5 | _VALID_URL = r'https?://volej\.tv/video/(?P<id>\d+)' | |
6 | _TESTS = [{ | |
7 | 'url': 'https://volej.tv/video/725742/', | |
8 | 'info_dict': { | |
9 | 'id': '725742', | |
10 | 'ext': 'mp4', | |
11 | 'description': 'Zápas VK Královo Pole vs VK Prostějov 10.12.2022 v 19:00 na Volej.TV', | |
12 | 'thumbnail': 'https://volej.tv/images/og/16/17186/og.png', | |
13 | 'title': 'VK Královo Pole vs VK Prostějov', | |
14 | } | |
15 | }, { | |
16 | 'url': 'https://volej.tv/video/725605/', | |
17 | 'info_dict': { | |
18 | 'id': '725605', | |
19 | 'ext': 'mp4', | |
20 | 'thumbnail': 'https://volej.tv/images/og/15/17185/og.png', | |
21 | 'title': 'VK Lvi Praha vs VK Euro Sitex Příbram', | |
22 | 'description': 'Zápas VK Lvi Praha vs VK Euro Sitex Příbram 11.12.2022 v 19:00 na Volej.TV', | |
23 | } | |
24 | }] | |
25 | ||
26 | def _real_extract(self, url): | |
27 | video_id = self._match_id(url) | |
28 | webpage = self._download_webpage(url, video_id) | |
29 | json_data = self._search_json( | |
30 | r'<\s*!\[CDATA[^=]+=', webpage, 'CDATA', video_id) | |
31 | formats, subtitle = self._extract_m3u8_formats_and_subtitles( | |
32 | json_data['urls']['hls'], video_id) | |
33 | return { | |
34 | 'id': video_id, | |
35 | 'title': self._html_search_meta(['og:title', 'twitter:title'], webpage), | |
36 | 'thumbnail': self._html_search_meta(['og:image', 'twitter:image'], webpage), | |
37 | 'description': self._html_search_meta(['description', 'og:description', 'twitter:description'], webpage), | |
38 | 'formats': formats, | |
39 | 'subtitles': subtitle, | |
40 | } |