3 from .common
import InfoExtractor
5 compat_urllib_parse_unquote
,
6 compat_urllib_parse_unquote_plus
,
14 class PlayvidIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://(?:www\.)?playvid\.com/watch(\?v=|/)(?P<id>.+?)(?:#|$)'
17 'url': 'http://www.playvid.com/watch/RnmBNgtrrJu',
18 'md5': 'ffa2f6b2119af359f544388d8c01eb6c',
22 'title': 'md5:9256d01c6317e3f703848b5906880dc8',
26 'skip': 'Video removed due to ToS',
28 'url': 'http://www.playvid.com/watch/hwb0GpNkzgH',
29 'md5': '39d49df503ad7b8f23a4432cbf046477',
33 'title': 'Ellen Euro Cutie Blond Takes a Sexy Survey Get Facial in The Park',
35 'thumbnail': r
're:^https?://.*\.jpg$',
39 def _real_extract(self
, url
):
40 video_id
= self
._match
_id
(url
)
41 webpage
= self
._download
_webpage
(url
, video_id
)
44 r
'<div class="block-error">\s*<div class="heading">\s*<div>(?P<msg>.+?)</div>\s*</div>', webpage
)
46 raise ExtractorError(clean_html(m_error
.group('msg')), expected
=True)
50 video_thumbnail
= None
53 # most of the information is stored in the flashvars
54 flashvars
= self
._html
_search
_regex
(
55 r
'flashvars="(.+?)"', webpage
, 'flashvars')
57 infos
= compat_urllib_parse_unquote(flashvars
).split(r
'&')
59 videovars_match
= re
.match(r
'^video_vars\[(.+?)\]=(.+?)$', info
)
61 key
= videovars_match
.group(1)
62 val
= videovars_match
.group(2)
65 video_title
= compat_urllib_parse_unquote_plus(val
)
71 if key
== 'big_thumb':
74 videourl_match
= re
.match(
75 r
'^video_urls\]\[(?P<resolution>[0-9]+)p', key
)
77 height
= int(videourl_match
.group('resolution'))
82 self
._sort
_formats
(formats
)
84 # Extract title - should be in the flashvars; if not, look elsewhere
85 if video_title
is None:
86 video_title
= self
._html
_extract
_title
(webpage
)
92 'thumbnail': video_thumbnail
,