]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/nuvid.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class NuvidIE(InfoExtractor
):
9 _VALID_URL
= r
'^https?://(?:www|m)\.nuvid\.com/video/(?P<id>[0-9]+)'
11 'url': 'http://m.nuvid.com/video/1310741/',
12 'md5': 'eab207b7ac4fccfb4e23c86201f11277',
16 "title": "Horny babes show their awesome bodeis and",
21 def _real_extract(self
, url
):
22 mobj
= re
.match(self
._VALID
_URL
, url
)
23 video_id
= mobj
.group('id')
25 murl
= url
.replace('://www.', '://m.')
26 webpage
= self
._download
_webpage
(murl
, video_id
)
28 title
= self
._html
_search
_regex
(
29 r
'<div class="title">\s+<h2[^>]*>([^<]+)</h2>',
30 webpage
, 'title').strip()
32 url_end
= self
._html
_search
_regex
(
33 r
'href="(/[^"]+)"[^>]*data-link_type="mp4"',
35 video_url
= 'http://m.nuvid.com' + url_end
37 thumbnail
= self
._html
_search
_regex
(
38 r
'href="(/thumbs/[^"]+)"[^>]*data-link_type="thumbs"',
39 webpage
, 'thumbnail URL', fatal
=False)
46 'thumbnail': thumbnail
,