1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-12-12 08:36:28 +01:00
yt-dlp/yt_dlp/extractor/matchtv.py

36 lines
1.2 KiB
Python
Raw Normal View History

2016-01-30 13:30:27 +01:00
from .common import InfoExtractor
class MatchTVIE(InfoExtractor):
_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 = [{
'url': 'http://matchtv.ru/on-air/',
2016-01-30 13:30:27 +01:00
'info_dict': {
'id': 'matchtv-live',
'ext': 'mp4',
'title': r're:^Матч ТВ - Прямой эфир \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
'live_status': 'is_live',
2016-01-30 13:30:27 +01:00
},
'params': {
'skip_download': True,
},
2016-06-11 20:57:23 +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'
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,
'formats': self._extract_m3u8_formats(video_url, video_id, 'mp4', live=True),
2016-01-30 13:30:27 +01:00
}