]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/moviezine.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / moviezine.py
CommitLineData
3f53a75f 1from .common import InfoExtractor
2
3
4class MoviezineIE(InfoExtractor):
92519402 5 _VALID_URL = r'https?://(?:www\.)?moviezine\.se/video/(?P<id>[^?#]+)'
3f53a75f 6
7 _TEST = {
8 'url': 'http://www.moviezine.se/video/205866',
9 'info_dict': {
10 'id': '205866',
11 'ext': 'mp4',
12 'title': 'Oculus - Trailer 1',
13 'description': 'md5:40cc6790fc81d931850ca9249b40e8a4',
ec85ded8 14 'thumbnail': r're:http://.*\.jpg',
3f53a75f 15 },
16 }
17
18 def _real_extract(self, url):
5ad28e7f 19 mobj = self._match_valid_url(url)
3f53a75f 20 video_id = mobj.group('id')
21
22 webpage = self._download_webpage(url, video_id)
add96eb9 23 jsplayer = self._download_webpage(f'http://www.moviezine.se/api/player.js?video={video_id}', video_id, 'Downloading js api player')
3f53a75f 24
5f6a1245 25 formats = [{
3f53a75f 26 'format_id': 'sd',
27 'url': self._html_search_regex(r'file: "(.+?)",', jsplayer, 'file'),
28 'quality': 0,
29 'ext': 'mp4',
30 }]
31
3f53a75f 32 return {
33 'id': video_id,
34 'title': self._search_regex(r'title: "(.+?)",', jsplayer, 'title'),
35 'thumbnail': self._search_regex(r'image: "(.+?)",', jsplayer, 'image'),
36 'formats': formats,
37 'description': self._og_search_description(webpage),
38 }