3 from .common
import InfoExtractor
14 class MassengeschmackTVIE(InfoExtractor
):
15 IE_NAME
= 'massengeschmack.tv'
16 _VALID_URL
= r
'https?://(?:www\.)?massengeschmack\.tv/play/(?P<id>[^?&#]+)'
19 'url': 'https://massengeschmack.tv/play/fktv202',
20 'md5': '9996f314994a49fefe5f39aa1b07ae21',
24 'title': 'Fernsehkritik-TV #202',
25 'thumbnail': 'https://cache.massengeschmack.tv/img/mag/fktv202.jpg',
29 def _real_extract(self
, url
):
30 episode
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, episode
)
33 sources
= self
._parse
_json
(self
._search
_regex
(r
'(?s)MEDIA\s*=\s*(\[.+?\]);', webpage
, 'media'), episode
, js_to_json
)
36 for source
in sources
:
37 furl
= source
.get('src')
40 furl
= self
._proto
_relative
_url
(furl
)
41 ext
= determine_ext(furl
) or mimetype2ext(source
.get('type'))
43 formats
.extend(self
._extract
_m
3u8_formats
(
44 furl
, episode
, 'mp4', 'm3u8_native',
45 m3u8_id
='hls', fatal
=False))
49 'format_id': determine_ext(furl
),
52 for (durl
, format_id
, width
, height
, filesize
) in re
.findall(r
'''(?x)
53 <a[^>]+?href="(?P<url>(?:https:)?//[^"]+)".*?
54 <strong>(?P<format_id>.+?)</strong>.*?
55 <small>(?:(?P<width>\d+)x(?P<height>\d+))?\s+?\((?P<filesize>[\d,]+\s*[GM]iB)\)</small>
59 'format_id': format_id
,
60 'width': int_or_none(width
),
61 'height': int_or_none(height
),
62 'filesize': parse_filesize(filesize
),
63 'vcodec': 'none' if format_id
.startswith('Audio') else None,
68 'title': clean_html(self
._html
_search
_regex
(
69 r
'<span[^>]+\bid=["\']clip
-title
["\'][^>]*>([^<]+)', webpage, 'title', fatal=False)),
71 'thumbnail': self._search_regex(r'POSTER\s*=\s*"([^
"]+)', webpage, 'thumbnail', fatal=False),