mirror of
https://github.com/l1ving/youtube-dl
synced 2024-11-22 13:02:51 +08:00
Merge remote-tracking branch 'pulpe/moviezinese'
This commit is contained in:
commit
29645a1d44
@ -160,6 +160,7 @@ from .mofosex import MofosexIE
|
|||||||
from .mooshare import MooshareIE
|
from .mooshare import MooshareIE
|
||||||
from .morningstar import MorningstarIE
|
from .morningstar import MorningstarIE
|
||||||
from .motorsport import MotorsportIE
|
from .motorsport import MotorsportIE
|
||||||
|
from .moviezine import MoviezineIE
|
||||||
from .movshare import MovShareIE
|
from .movshare import MovShareIE
|
||||||
from .mtv import (
|
from .mtv import (
|
||||||
MTVIE,
|
MTVIE,
|
||||||
|
45
youtube_dl/extractor/moviezine.py
Normal file
45
youtube_dl/extractor/moviezine.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
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': 're:http://.*\.jpg',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._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),
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user