]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/eporner.py
ac5d0fe2426a8e3fb213b2bb6d8f59fa8acc5fba
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class EpornerIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\w+)/(?P<display_id>[\w-]+)'
16 'url': 'http://www.eporner.com/hd-porn/95008/Infamous-Tiffany-Teen-Strip-Tease-Video/',
17 'md5': '39d486f046212d8e1b911c52ab4691f8',
20 'display_id': 'Infamous-Tiffany-Teen-Strip-Tease-Video',
22 'title': 'Infamous Tiffany Teen Strip Tease Video',
28 # New (May 2016) URL layout
29 'url': 'http://www.eporner.com/hd-porn/3YRUtzMcWn0/Star-Wars-XXX-Parody/',
30 'only_matching': True,
33 def _real_extract(self
, url
):
34 mobj
= re
.match(self
._VALID
_URL
, url
)
35 video_id
= mobj
.group('id')
36 display_id
= mobj
.group('display_id')
38 webpage
= self
._download
_webpage
(url
, display_id
)
39 title
= self
._html
_search
_regex
(
40 r
'<title>(.*?) - EPORNER', webpage
, 'title')
42 redirect_url
= 'http://www.eporner.com/config5/%s' % video_id
43 player_code
= self
._download
_webpage
(
44 redirect_url
, display_id
, note
='Downloading player config')
46 sources
= self
._search
_regex
(
47 r
'(?s)sources\s*:\s*\[\s*({.+?})\s*\]', player_code
, 'sources')
50 for video_url
, format_id
in re
.findall(r
'file\s*:\s*"([^"]+)",\s*label\s*:\s*"([^"]+)"', sources
):
53 'format_id': format_id
,
55 m
= re
.search(r
'^(\d+)', format_id
)
57 fmt
['height'] = int(m
.group(1))
59 self
._sort
_formats
(formats
)
61 duration
= parse_duration(self
._html
_search
_meta
('duration', webpage
))
62 view_count
= str_to_int(self
._search
_regex
(
63 r
'id="cinemaviews">\s*([0-9,]+)\s*<small>views',
64 webpage
, 'view count', fatal
=False))
68 'display_id': display_id
,
71 'view_count': view_count
,