]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/keezmovies.py
126ca13df1b8c30e9d94b204beb54eab03644fea
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
12 class KeezMoviesIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?keezmovies\.com/video/.+?(?P<id>[0-9]+)(?:[/?&]|$)'
15 'url': 'http://www.keezmovies.com/video/petite-asian-lady-mai-playing-in-bathtub-1214711',
16 'md5': '1c1e75d22ffa53320f45eeb07bc4cdc0',
20 'title': 'Petite Asian Lady Mai Playing In Bathtub',
22 'thumbnail': 're:^https?://.*\.jpg$',
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
29 req
= sanitized_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 flashvars
= self
._parse
_json
(self
._search
_regex
(
42 r
'var\s+flashvars\s*=\s*([^;]+);', webpage
, 'flashvars'), video_id
)
45 for height
in (180, 240, 480):
46 if flashvars
.get('quality_%dp' % height
):
47 video_url
= flashvars
['quality_%dp' % height
]
51 'format_id': '%dp' % height
,
53 filename_parts
= url_basename(video_url
).split('_')
54 if len(filename_parts
) >= 2 and re
.match(r
'\d+[Kk]', filename_parts
[1]):
55 a_format
['tbr'] = int(filename_parts
[1][:-1])
56 formats
.append(a_format
)
58 age_limit
= self
._rta
_search
(webpage
)
64 'age_limit': age_limit
,
65 'thumbnail': flashvars
.get('image_url')