]>
Commit | Line | Data |
---|---|---|
1 | from .common import InfoExtractor | |
2 | ||
3 | ||
4 | class MatchTVIE(InfoExtractor): | |
5 | _VALID_URL = [ | |
6 | r'https?://matchtv\.ru/on-air/?(?:$|[?#])', | |
7 | r'https?://video\.matchtv\.ru/iframe/channel/106/?(?:$|[?#])', | |
8 | ] | |
9 | _TESTS = [{ | |
10 | 'url': 'http://matchtv.ru/on-air/', | |
11 | 'info_dict': { | |
12 | 'id': 'matchtv-live', | |
13 | 'ext': 'mp4', | |
14 | 'title': r're:^Матч ТВ - Прямой эфир \d{4}-\d{2}-\d{2} \d{2}:\d{2}$', | |
15 | 'live_status': 'is_live', | |
16 | }, | |
17 | 'params': { | |
18 | 'skip_download': True, | |
19 | }, | |
20 | }, { | |
21 | 'url': 'https://video.matchtv.ru/iframe/channel/106', | |
22 | 'only_matching': True, | |
23 | }] | |
24 | ||
25 | def _real_extract(self, url): | |
26 | video_id = 'matchtv-live' | |
27 | webpage = self._download_webpage('https://video.matchtv.ru/iframe/channel/106', video_id) | |
28 | video_url = self._html_search_regex( | |
29 | r'data-config="config=(https?://[^?"]+)[?"]', webpage, 'video URL').replace('/feed/', '/media/') + '.m3u8' | |
30 | return { | |
31 | 'id': video_id, | |
32 | 'title': 'Матч ТВ - Прямой эфир', | |
33 | 'is_live': True, | |
34 | 'formats': self._extract_m3u8_formats(video_url, video_id, 'mp4', live=True), | |
35 | } |