1 from .common
import InfoExtractor
8 class TwentyMinutenIE(InfoExtractor
):
15 videoplayer/videoplayer\.html\?.*?\bvideoId@
19 _EMBED_REGEX
= [r
'<iframe[^>]+src=(["\'])(?P
<url
>(?
:(?
:https?
:)?
//)?
(?
:www\
.)?
20min\
.ch
/videoplayer
/videoplayer
.html
\?.*?
\bvideoId
@\d
+.*?
)\
1']
21 'url
': 'http
://www
.20min.ch
/videotv
/?vid
=469148&cid
=2',
22 'md5
': 'e7264320db31eed8c38364150c12496e
',
26 'title
': '85 000 Franken für
15 perfekte Minuten
',
27 'thumbnail
': r're
:https?
://.*\
.jpg$
',
30 'url
': 'http
://www
.20min.ch
/videoplayer
/videoplayer
.html?params
=client
@twentyDE|videoId
@523629',
34 'title
': 'So kommen Sie bei Eis und Schnee sicher an
',
35 'description
': 'md5
:117c212f64b25e3d95747e5276863f7d
',
36 'thumbnail
': r're
:https?
://.*\
.jpg$
',
39 'skip_download
': True,
42 'url
': 'http
://www
.20min.ch
/videotv
/?cid
=44&vid
=468738',
43 'only_matching
': True,
46 def _real_extract(self, url):
47 video_id = self._match_id(url)
49 video = self._download_json(
50 f'http
://api
.20min.ch
/video
/{video_id}
/show
',
53 title = video['title
']
56 'format_id
': format_id,
57 'url
': f'http
://podcast
.20min-tv
.ch
/podcast
/20min/{video_id}{p}
.mp4
',
59 } for quality, (format_id, p) in enumerate([('sd
', ''), ('hd
', 'h
')])]
61 description = video.get('lead
')
62 thumbnail = video.get('thumbnail
')
64 def extract_count(kind):
67 lambda x: int_or_none(x['communityobject
'][f'thumbs_{kind}
']))
69 like_count = extract_count('up
')
70 dislike_count = extract_count('down
')
75 'description
': description,
76 'thumbnail
': thumbnail,
77 'like_count
': like_count,
78 'dislike_count
': dislike_count,