3 from .common
import InfoExtractor
11 class MuenchenTVIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?muenchen\.tv/livestream'
14 IE_DESC
= 'münchen.tv'
16 'url': 'http://www.muenchen.tv/livestream/',
21 'title': 're:^münchen.tv-Livestream [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
23 'thumbnail': r
're:^https?://.*\.jpg$'
26 'skip_download': True,
30 def _real_extract(self
, url
):
32 webpage
= self
._download
_webpage
(url
, display_id
)
34 title
= self
._og
_search
_title
(webpage
)
36 data_js
= self
._search
_regex
(
37 r
'(?s)\nplaylist:\s*(\[.*?}\]),',
38 webpage
, 'playlist configuration')
39 data_json
= js_to_json(data_js
)
40 data
= json
.loads(data_json
)[0]
42 video_id
= data
['mediaid']
43 thumbnail
= data
.get('image')
46 for format_num
, s
in enumerate(data
['sources']):
47 ext
= determine_ext(s
['file'], None)
48 label_str
= s
.get('label')
50 label_str
= '_%d' % format_num
55 format_id
= '%s-%s' % (ext
, label_str
)
59 'tbr': int_or_none(s
.get('label')),
61 'format_id': format_id
,
62 'preference': -100 if '.smil' in s
['file'] else 0, # Strictly inferior than all other formats?
67 'display_id': display_id
,
71 'thumbnail': thumbnail
,