]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/massengeschmacktv.py
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': 'a9e054db9c2b5a08f0a0527cc201e8d3',
24 'title': 'Fernsehkritik-TV - Folge 202',
28 def _real_extract(self
, url
):
29 episode
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, episode
)
32 title
= clean_html(self
._html
_search
_regex
(
33 '<h3>([^<]+)</h3>', webpage
, 'title'))
34 thumbnail
= self
._search
_regex
(r
'POSTER\s*=\s*"([^"]+)', webpage
, 'thumbnail', fatal
=False)
35 sources
= self
._parse
_json
(self
._search
_regex
(r
'(?s)MEDIA\s*=\s*(\[.+?\]);', webpage
, 'media'), episode
, js_to_json
)
38 for source
in sources
:
39 furl
= source
.get('src')
42 furl
= self
._proto
_relative
_url
(furl
)
43 ext
= determine_ext(furl
) or mimetype2ext(source
.get('type'))
45 formats
.extend(self
._extract
_m
3u8_formats
(
46 furl
, episode
, 'mp4', 'm3u8_native',
47 m3u8_id
='hls', fatal
=False))
51 'format_id': determine_ext(furl
),
54 for (durl
, format_id
, width
, height
, filesize
) in re
.findall(r
'''(?x)
55 <a[^>]+?href="(?P<url>(?:https:)?//[^"]+)".*?
56 <strong>(?P<format_id>.+?)</strong>.*?
57 <small>(?:(?P<width>\d+)x(?P<height>\d+))?\s+?\((?P<filesize>[\d,]+\s*[GM]iB)\)</small>
61 'format_id': format_id
,
62 'width': int_or_none(width
),
63 'height': int_or_none(height
),
64 'filesize': parse_filesize(filesize
),
65 'vcodec': 'none' if format_id
.startswith('Audio') else None,
68 self
._sort
_formats
(formats
)
74 'thumbnail': thumbnail
,