]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/hornbunny.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..utils
import int_or_none
9 class HornBunnyIE(InfoExtractor
):
10 _VALID_URL
= r
'http?://(?:www\.)?hornbunny\.com/videos/(?P<title_dash>[a-z-]+)-(?P<id>\d+)\.html'
12 'url': 'http://hornbunny.com/videos/panty-slut-jerk-off-instruction-5227.html',
13 'md5': '95e40865aedd08eff60272b704852ad7',
17 'title': 'panty slut jerk off instruction',
22 def _real_extract(self
, url
):
23 mobj
= re
.match(self
._VALID
_URL
, url
)
24 video_id
= mobj
.group('id')
26 webpage
= self
._download
_webpage
(url
, video_id
)
27 title
= self
._html
_search
_regex
(r
'class="title">(.*?)</h2>', webpage
, 'title')
28 redirect_url
= self
._html
_search
_regex
(r
'pg&settings=(.*?)\|0"\);', webpage
, 'title')
29 webpage2
= self
._download
_webpage
(redirect_url
, video_id
)
30 video_url
= self
._html
_search
_regex
(r
'flvMask:(.*?);', webpage2
, 'video_url')
32 mobj
= re
.search(r
'<strong>Runtime:</strong> (?P<minutes>\d+):(?P<seconds>\d+)</div>', webpage
)
33 duration
= int(mobj
.group('minutes')) * 60 + int(mobj
.group('seconds')) if mobj
else None
35 view_count
= self
._html
_search
_regex
(r
'<strong>Views:</strong> (\d+)</div>', webpage
, 'view count', fatal
=False)
43 'view_count': int_or_none(view_count
),