4 from .common
import InfoExtractor
12 class VuClipIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:m\.)?vuclip\.com/w\?.*?cid=(?P<id>[0-9]+)'
16 'url': 'http://m.vuclip.com/w?cid=1129900602&bu=8589892792&frm=w&z=34801&op=0&oc=843169247§ion=recommend',
20 'title': 'Top 10 TV Convicts',
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
27 webpage
= self
._download
_webpage
(url
, video_id
)
30 r
'''value="No.*?" onClick="location.href='([^"']+)'"''', webpage
)
32 urlr
= urllib
.parse
.urlparse(url
)
33 adfree_url
= urlr
.scheme
+ '://' + urlr
.netloc
+ ad_m
.group(1)
34 webpage
= self
._download
_webpage
(
35 adfree_url
, video_id
, note
='Download post-ad page')
37 error_msg
= self
._html
_search
_regex
(
38 r
'<p class="message">(.*?)</p>', webpage
, 'error message',
42 f
'{self.IE_NAME} said: {error_msg}', expected
=True)
44 # These clowns alternate between two page types
45 video_url
= self
._search
_regex
(
46 r
'<a[^>]+href="([^"]+)"[^>]*><img[^>]+src="[^"]*/play\.gif',
47 webpage
, 'video URL', default
=None)
53 formats
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)[0]['formats']
55 title
= remove_end(self
._html
_search
_regex
(
56 r
'<title>(.*?)-\s*Vuclip</title>', webpage
, 'title').strip(), ' - Video')
58 duration
= parse_duration(self
._html
_search
_regex
(
59 r
'[(>]([0-9]+:[0-9]+)(?:<span|\))', webpage
, 'duration', fatal
=False))