1 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
   8     compat_urllib_parse_urlparse
, 
  13 class KeezMoviesIE(InfoExtractor
): 
  14     _VALID_URL 
= r
'https?://(?:www\.)?keezmovies\.com/video/.+?(?P<id>[0-9]+)(?:[/?&]|$)' 
  16         'url': 'http://www.keezmovies.com/video/petite-asian-lady-mai-playing-in-bathtub-1214711', 
  17         'md5': '6e297b7e789329923fcf83abb67c9289', 
  21             'title': 'Petite Asian Lady Mai Playing In Bathtub', 
  26     def _real_extract(self
, url
): 
  27         video_id 
= self
._match
_id
(url
) 
  29         req 
= compat_urllib_request
.Request(url
) 
  30         req
.add_header('Cookie', 'age_verified=1') 
  31         webpage 
= self
._download
_webpage
(req
, video_id
) 
  34         mobj 
= re
.search(r
'href="([^"]+)"></iframe>', webpage
) 
  36             embedded_url 
= mobj
.group(1) 
  37             return self
.url_result(embedded_url
) 
  39         video_title 
= self
._html
_search
_regex
( 
  40             r
'<h1 [^>]*>([^<]+)', webpage
, 'title') 
  41         video_url 
= self
._html
_search
_regex
( 
  42             r
'(?s)html5VideoPlayer = .*?src="([^"]+)"', webpage
, 'video URL') 
  43         path 
= compat_urllib_parse_urlparse(video_url
).path
 
  44         extension 
= os
.path
.splitext(path
)[1][1:] 
  45         format 
= path
.split('/')[4].split('_')[:2] 
  46         format 
= "-".join(format
) 
  48         age_limit 
= self
._rta
_search
(webpage
) 
  57             'age_limit': age_limit
,