]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/moviezine.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / moviezine.py
1 from .common import InfoExtractor
2
3
4 class MoviezineIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?moviezine\.se/video/(?P<id>[^?#]+)'
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',
14 'thumbnail': r're:http://.*\.jpg',
15 },
16 }
17
18 def _real_extract(self, url):
19 mobj = self._match_valid_url(url)
20 video_id = mobj.group('id')
21
22 webpage = self._download_webpage(url, video_id)
23 jsplayer = self._download_webpage(f'http://www.moviezine.se/api/player.js?video={video_id}', video_id, 'Downloading js api player')
24
25 formats = [{
26 'format_id': 'sd',
27 'url': self._html_search_regex(r'file: "(.+?)",', jsplayer, 'file'),
28 'quality': 0,
29 'ext': 'mp4',
30 }]
31
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 }