From: Philipp Hagemeister Date: Tue, 13 May 2014 08:05:20 +0000 (+0200) Subject: Merge remote-tracking branch 'hojel/nuvid' X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=b65c3e77e8fa893a41eb058102422f42276ebc11;hp=5301304bf2785888454d41d27c20e743a2501f1a;p=youtube-dl.git Merge remote-tracking branch 'hojel/nuvid' --- diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 5095f14b6..84a1830d0 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -195,6 +195,7 @@ from .nowvideo import NowVideoIE from .nrk import NRKIE from .ntv import NTVIE from .nytimes import NYTimesIE +from .nuvid import NuvidIE from .oe1 import OE1IE from .ooyala import OoyalaIE from .orf import ORFIE diff --git a/youtube_dl/extractor/nuvid.py b/youtube_dl/extractor/nuvid.py new file mode 100644 index 000000000..2e5198c1a --- /dev/null +++ b/youtube_dl/extractor/nuvid.py @@ -0,0 +1,39 @@ +import re + +from .common import InfoExtractor + +class NuvidIE(InfoExtractor): + _VALID_URL = r'^https?://(?:www|m)\.nuvid\.com/video/(?P\d+)' + _TEST = { + u'url': u'http://m.nuvid.com/video/1310741/', + u'file': u'1310741.mp4', + u'md5': u'eab207b7ac4fccfb4e23c86201f11277', + u'info_dict': { + u"title": u"Horny babes show their awesome bodeis and", + u"age_limit": 18, + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + + video_id = mobj.group('videoid') + + # Get webpage content + murl = url.replace('//www.', '//m.') + webpage = self._download_webpage(murl, video_id) + + video_title = self._html_search_regex(r'
\s+]*>([^<]+)', webpage, 'video_title').strip() + + video_url = 'http://m.nuvid.com'+self._html_search_regex(r'href="(/mp4/[^"]+)"[^>]*data-link_type="mp4"', webpage, 'video_url') + + video_thumb = self._html_search_regex(r'href="(/thumbs/[^"]+)"[^>]*data-link_type="thumbs"', webpage, 'video_thumb') + + info = {'id': video_id, + 'url': video_url, + 'title': video_title, + 'thumbnail': video_thumb, + 'ext': 'mp4', + 'age_limit': 18} + + return [info]