1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
7 compat_urllib_parse_urlparse
,
16 class VuClipIE(InfoExtractor
):
17 _VALID_URL
= r
'https?://(?:m\.)?vuclip\.com/w\?.*?cid=(?P<id>[0-9]+)'
20 'url': 'http://m.vuclip.com/w?cid=922692425&fid=70295&z=1010&nvar&frm=index.html',
24 'title': 'The Toy Soldiers - Hollywood Movie Trailer',
29 def _real_extract(self
, url
):
30 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, video_id
)
34 r
'''value="No.*?" onClick="location.href='([^"']+)'"''', webpage
)
36 urlr
= compat_urllib_parse_urlparse(url
)
37 adfree_url
= urlr
.scheme
+ '://' + urlr
.netloc
+ ad_m
.group(1)
38 webpage
= self
._download
_webpage
(
39 adfree_url
, video_id
, note
='Download post-ad page')
41 error_msg
= self
._html
_search
_regex
(
42 r
'<p class="message">(.*?)</p>', webpage
, 'error message',
46 '%s said: %s' % (self
.IE_NAME
, error_msg
), expected
=True)
48 # These clowns alternate between two page types
49 links_code
= self
._search
_regex
(
52 <img\s+src="[^"]*/play.gif".*?>|
53 <!--\ player\ end\ -->\s*</div><!--\ thumb\ end-->
57 <a\s+href="fblike|<div\s+class="social">
59 ''', webpage
, 'links')
60 title
= self
._html
_search
_regex
(
61 r
'<title>(.*?)-\s*Vuclip</title>', webpage
, 'title').strip()
63 quality_order
= qualities(['Reg', 'Hi'])
65 for url
, q
in re
.findall(
66 r
'<a\s+href="(?P<url>[^"]+)".*?>(?:<button[^>]*>)?(?P<q>[^<]+)(?:</button>)?</a>', links_code
):
67 format_id
= compat_urllib_parse_urlparse(url
).scheme
+ '-' + q
69 'format_id': format_id
,
71 'quality': quality_order(q
),
73 self
._sort
_formats
(formats
)
75 duration
= parse_duration(self
._search
_regex
(
76 r
'\(([0-9:]+)\)</span>', webpage
, 'duration', fatal
=False))