diff options
| author | Philipp Hagemeister <phihag@phihag.de> | 2014-04-30 01:37:05 +0200 | 
|---|---|---|
| committer | Philipp Hagemeister <phihag@phihag.de> | 2014-04-30 01:37:05 +0200 | 
| commit | 29645a1d4471d527ab6ff5fc3c36d52ae2c8c6ea (patch) | |
| tree | bcee56ce38408a7aef084e01867729784de57af9 | |
| parent | 22d99a801ab2291beed7b9b9e8244fc9ceab39f0 (diff) | |
| parent | 3f53a75f020de08ee457b0bd9e5dd0e542f6d645 (diff) | |
Merge remote-tracking branch 'pulpe/moviezinese'
| -rw-r--r-- | youtube_dl/extractor/__init__.py | 1 | ||||
| -rw-r--r-- | youtube_dl/extractor/moviezine.py | 45 | 
2 files changed, 46 insertions, 0 deletions
| diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 4b53bef5c..e27cd2d2d 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -160,6 +160,7 @@ from .mofosex import MofosexIE  from .mooshare import MooshareIE  from .morningstar import MorningstarIE  from .motorsport import MotorsportIE +from .moviezine import MoviezineIE  from .movshare import MovShareIE  from .mtv import (      MTVIE, diff --git a/youtube_dl/extractor/moviezine.py b/youtube_dl/extractor/moviezine.py new file mode 100644 index 000000000..43146180a --- /dev/null +++ b/youtube_dl/extractor/moviezine.py @@ -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), +        } | 
