1 from __future__
import unicode_literals
6 from .common
import InfoExtractor
8 compat_urllib_parse_urlparse
,
17 class KeezMoviesIE(InfoExtractor
):
18 _VALID_URL
= r
'^https?://(?:www\.)?keezmovies\.com/video/.+?(?P<videoid>[0-9]+)(?:[/?&]|$)'
20 'url': 'http://www.keezmovies.com/video/petite-asian-lady-mai-playing-in-bathtub-1214711',
21 'file': '1214711.mp4',
22 'md5': '6e297b7e789329923fcf83abb67c9289',
24 'title': 'Petite Asian Lady Mai Playing In Bathtub',
29 def _real_extract(self
, url
):
30 mobj
= re
.match(self
._VALID
_URL
, url
)
31 video_id
= mobj
.group('videoid')
33 req
= compat_urllib_request
.Request(url
)
34 req
.add_header('Cookie', 'age_verified=1')
35 webpage
= self
._download
_webpage
(req
, video_id
)
38 mobj
= re
.search(r
'href="([^"]+)"></iframe>', webpage
)
40 embedded_url
= mobj
.group(1)
41 return self
.url_result(embedded_url
)
43 video_title
= self
._html
_search
_regex
(r
'<h1 [^>]*>([^<]+)', webpage
, 'title')
44 video_url
= compat_urllib_parse
.unquote(self
._html
_search
_regex
(r
'video_url=(.+?)&', webpage
, 'video_url'))
45 if 'encrypted=true' in webpage
:
46 password
= self
._html
_search
_regex
(r
'video_title=(.+?)&', webpage
, 'password')
47 video_url
= aes_decrypt_text(video_url
, password
, 32).decode('utf-8')
48 path
= compat_urllib_parse_urlparse(video_url
).path
49 extension
= os
.path
.splitext(path
)[1][1:]
50 format
= path
.split('/')[4].split('_')[:2]
51 format
= "-".join(format
)
53 age_limit
= self
._rta
_search
(webpage
)
62 'age_limit': age_limit
,