[ie/wistia] Support password-protected videos (#11100)
[yt-dlp3.git] / yt_dlp / extractor / moviezine.py
blob331a56234bce3237d986477fd826682132fa196b
1 from .common import InfoExtractor
4 class MoviezineIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?moviezine\.se/video/(?P<id>[^?#]+)'
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',
18 def _real_extract(self, url):
19 mobj = self._match_valid_url(url)
20 video_id = mobj.group('id')
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')
25 formats = [{
26 'format_id': 'sd',
27 'url': self._html_search_regex(r'file: "(.+?)",', jsplayer, 'file'),
28 'quality': 0,
29 'ext': 'mp4',
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),