]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/matchtv.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..utils
import xpath_text
10 class MatchTVIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://matchtv\.ru(?:/on-air|/?#live-player)'
13 'url': 'http://matchtv.ru/#live-player',
17 'title': r
're:^Матч ТВ - Прямой эфир \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
21 'skip_download': True,
24 'url': 'http://matchtv.ru/on-air/',
25 'only_matching': True,
28 def _real_extract(self
, url
):
29 video_id
= 'matchtv-live'
30 video_url
= self
._download
_json
(
31 'http://player.matchtv.ntvplus.tv/player/smil', video_id
,
35 'contentId': '561d2c0df7159b37178b4567',
37 'includeHighlights': '0',
39 'sessionId': random
.randint(1, 1000000000),
40 'contentType': 'channel',
45 'Referer': 'http://player.matchtv.ntvplus.tv/embed-player/NTVEmbedPlayer.swf',
46 })['data']['videoUrl']
47 f4m_url
= xpath_text(self
._download
_xml
(video_url
, video_id
), './to')
48 formats
= self
._extract
_f
4m
_formats
(f4m_url
, video_id
)
49 self
._sort
_formats
(formats
)
52 'title': self
._live
_title
('Матч ТВ - Прямой эфир'),