]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/muenchentv.py
3 from .common
import InfoExtractor
11 class MuenchenTVIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?muenchen\.tv/livestream'
13 IE_DESC
= 'münchen.tv'
15 'url': 'http://www.muenchen.tv/livestream/',
20 'title': 're:^münchen.tv-Livestream [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
22 'thumbnail': r
're:^https?://.*\.jpg$'
25 'skip_download': True,
29 def _real_extract(self
, url
):
31 webpage
= self
._download
_webpage
(url
, display_id
)
33 title
= self
._og
_search
_title
(webpage
)
35 data_js
= self
._search
_regex
(
36 r
'(?s)\nplaylist:\s*(\[.*?}\]),',
37 webpage
, 'playlist configuration')
38 data_json
= js_to_json(data_js
)
39 data
= json
.loads(data_json
)[0]
41 video_id
= data
['mediaid']
42 thumbnail
= data
.get('image')
45 for format_num
, s
in enumerate(data
['sources']):
46 ext
= determine_ext(s
['file'], None)
47 label_str
= s
.get('label')
49 label_str
= '_%d' % format_num
54 format_id
= '%s-%s' % (ext
, label_str
)
58 'tbr': int_or_none(s
.get('label')),
60 'format_id': format_id
,
61 'preference': -100 if '.smil' in s
['file'] else 0, # Strictly inferior than all other formats?
63 self
._sort
_formats
(formats
)
67 'display_id': display_id
,
71 'thumbnail': thumbnail
,