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