2016-01-30 07:30:27 -05:00
|
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MatchTVIE(InfoExtractor):
|
2024-06-24 18:49:09 -04:00
|
|
|
|
_VALID_URL = [
|
|
|
|
|
r'https?://matchtv\.ru/on-air/?(?:$|[?#])',
|
|
|
|
|
r'https?://video\.matchtv\.ru/iframe/channel/106/?(?:$|[?#])',
|
|
|
|
|
]
|
2016-06-11 14:57:23 -04:00
|
|
|
|
_TESTS = [{
|
2024-06-24 18:49:09 -04:00
|
|
|
|
'url': 'http://matchtv.ru/on-air/',
|
2016-01-30 07:30:27 -05:00
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': 'matchtv-live',
|
2024-06-24 18:49:09 -04:00
|
|
|
|
'ext': 'mp4',
|
2017-01-02 07:08:07 -05:00
|
|
|
|
'title': r're:^Матч ТВ - Прямой эфир \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
|
2024-06-24 18:49:09 -04:00
|
|
|
|
'live_status': 'is_live',
|
2016-01-30 07:30:27 -05:00
|
|
|
|
},
|
|
|
|
|
'params': {
|
|
|
|
|
'skip_download': True,
|
|
|
|
|
},
|
2016-06-11 14:57:23 -04:00
|
|
|
|
}, {
|
2024-06-24 18:49:09 -04:00
|
|
|
|
'url': 'https://video.matchtv.ru/iframe/channel/106',
|
2016-06-11 14:57:23 -04:00
|
|
|
|
'only_matching': True,
|
|
|
|
|
}]
|
2016-01-30 07:30:27 -05:00
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
|
video_id = 'matchtv-live'
|
2024-06-24 18:49:09 -04:00
|
|
|
|
webpage = self._download_webpage('https://video.matchtv.ru/iframe/channel/106', video_id)
|
|
|
|
|
video_url = self._html_search_regex(
|
|
|
|
|
r'data-config="config=(https?://[^?"]+)[?"]', webpage, 'video URL').replace('/feed/', '/media/') + '.m3u8'
|
2016-01-30 07:30:27 -05:00
|
|
|
|
return {
|
|
|
|
|
'id': video_id,
|
2021-12-15 11:00:46 -05:00
|
|
|
|
'title': 'Матч ТВ - Прямой эфир',
|
2016-01-30 07:30:27 -05:00
|
|
|
|
'is_live': True,
|
2024-06-24 18:49:09 -04:00
|
|
|
|
'formats': self._extract_m3u8_formats(video_url, video_id, 'mp4', live=True),
|
2016-01-30 07:30:27 -05:00
|
|
|
|
}
|