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