]>
Commit | Line | Data |
---|---|---|
3f53a75f | 1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class 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) | |
23 | jsplayer = self._download_webpage('http://www.moviezine.se/api/player.js?video=%s' % video_id, video_id, 'Downloading js api player') | |
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 | ||
32 | self._sort_formats(formats) | |
33 | ||
34 | return { | |
35 | 'id': video_id, | |
36 | 'title': self._search_regex(r'title: "(.+?)",', jsplayer, 'title'), | |
37 | 'thumbnail': self._search_regex(r'image: "(.+?)",', jsplayer, 'image'), | |
38 | 'formats': formats, | |
39 | 'description': self._og_search_description(webpage), | |
40 | } |