2 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..utils import int_or_none
9 class EpornerIE(InfoExtractor):
10 _VALID_URL = r'http?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\d+)/(?P<title_dash>[\w-]+)/?'
12 'url': 'http://www.eporner.com/hd-porn/95008/Infamous-Tiffany-Teen-Strip-Tease-Video/',
13 'md5': '3b427ae4b9d60619106de3185c2987cd',
17 'title': 'Infamous Tiffany Teen Strip Tease Video',
22 def _real_extract(self, url):
23 mobj = re.match(self._VALID_URL, url)
24 video_id = mobj.group('id')
25 webpage = self._download_webpage(url, video_id)
26 title = self._html_search_regex(r'<title>(.*?) - EPORNER', webpage, 'title')
28 redirect_code = self._html_search_regex(r'<script type="text/javascript" src="/config5/'+str(video_id)+'/([a-f\d]+)/">', webpage, 'redirect_code')
29 redirect_url = 'http://www.eporner.com/config5/' + str(video_id) +'/'+ redirect_code
30 webpage2 = self._download_webpage(redirect_url, video_id)
31 video_url = self._html_search_regex(r'file: "(.*?)",', webpage2, 'video_url')
33 mobj = re.search(r'class="mbtim">(?P<minutes>\d+):(?P<seconds>\d+)</div>', webpage)
34 duration = int(mobj.group('minutes')) * 60 + int(mobj.group('seconds')) if mobj else None
36 mobj = re.search(r'id="cinemaviews">((?P<thousands>\d+),)?(?P<units>\d+)<small>views', webpage)
38 view_count = int(mobj.group('units'))
39 view_count += int(mobj.group('thousands')) * 1000
47 'duration': int_or_none(duration),
48 'view_count': int_or_none(view_count),