86e5f3ed2e
Using https://github.com/asottile/pyupgrade 1. `__future__` imports and `coding: utf-8` were removed 2. Files were rewritten with `pyupgrade --py36-plus --keep-percent-format` 3. f-strings were cherry-picked from `pyupgrade --py36-plus` Extractors are left untouched (except removing header) to avoid unnecessary merge conflicts
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
from .common import InfoExtractor
|
|
|
|
|
|
class MoviezineIE(InfoExtractor):
|
|
_VALID_URL = r'https?://(?:www\.)?moviezine\.se/video/(?P<id>[^?#]+)'
|
|
|
|
_TEST = {
|
|
'url': 'http://www.moviezine.se/video/205866',
|
|
'info_dict': {
|
|
'id': '205866',
|
|
'ext': 'mp4',
|
|
'title': 'Oculus - Trailer 1',
|
|
'description': 'md5:40cc6790fc81d931850ca9249b40e8a4',
|
|
'thumbnail': r're:http://.*\.jpg',
|
|
},
|
|
}
|
|
|
|
def _real_extract(self, url):
|
|
mobj = self._match_valid_url(url)
|
|
video_id = mobj.group('id')
|
|
|
|
webpage = self._download_webpage(url, video_id)
|
|
jsplayer = self._download_webpage('http://www.moviezine.se/api/player.js?video=%s' % video_id, video_id, 'Downloading js api player')
|
|
|
|
formats = [{
|
|
'format_id': 'sd',
|
|
'url': self._html_search_regex(r'file: "(.+?)",', jsplayer, 'file'),
|
|
'quality': 0,
|
|
'ext': 'mp4',
|
|
}]
|
|
|
|
self._sort_formats(formats)
|
|
|
|
return {
|
|
'id': video_id,
|
|
'title': self._search_regex(r'title: "(.+?)",', jsplayer, 'title'),
|
|
'thumbnail': self._search_regex(r'image: "(.+?)",', jsplayer, 'image'),
|
|
'formats': formats,
|
|
'description': self._og_search_description(webpage),
|
|
}
|