]>
Commit | Line | Data |
---|---|---|
bbc9dc56 | 1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
bbc9dc56 | 4 | from .common import InfoExtractor |
e4039057 PH |
5 | from ..utils import ( |
6 | int_or_none, | |
7 | parse_duration, | |
8 | ) | |
9 | ||
bbc9dc56 | 10 | |
11 | class HornBunnyIE(InfoExtractor): | |
12 | _VALID_URL = r'http?://(?:www\.)?hornbunny\.com/videos/(?P<title_dash>[a-z-]+)-(?P<id>\d+)\.html' | |
13 | _TEST = { | |
14 | 'url': 'http://hornbunny.com/videos/panty-slut-jerk-off-instruction-5227.html', | |
ec870511 | 15 | 'md5': 'e20fd862d1894b67564c96f180f43924', |
bbc9dc56 | 16 | 'info_dict': { |
17 | 'id': '5227', | |
ec870511 | 18 | 'ext': 'mp4', |
bbc9dc56 | 19 | 'title': 'panty slut jerk off instruction', |
e4039057 PH |
20 | 'duration': 550, |
21 | 'age_limit': 18, | |
ec870511 | 22 | 'view_count': int, |
ec85ded8 | 23 | 'thumbnail': r're:^https?://.*\.jpg$', |
bbc9dc56 | 24 | } |
25 | } | |
26 | ||
27 | def _real_extract(self, url): | |
ec870511 YCH |
28 | video_id = self._match_id(url) |
29 | ||
30 | webpage = self._download_webpage(url, video_id) | |
31 | title = self._og_search_title(webpage) | |
32 | info_dict = self._parse_html5_media_entries(url, webpage, video_id)[0] | |
5f6a1245 | 33 | |
e4039057 PH |
34 | duration = parse_duration(self._search_regex( |
35 | r'<strong>Runtime:</strong>\s*([0-9:]+)</div>', | |
36 | webpage, 'duration', fatal=False)) | |
37 | view_count = int_or_none(self._search_regex( | |
38 | r'<strong>Views:</strong>\s*(\d+)</div>', | |
39 | webpage, 'view count', fatal=False)) | |
bbc9dc56 | 40 | |
ec870511 | 41 | info_dict.update({ |
bbc9dc56 | 42 | 'id': video_id, |
bbc9dc56 | 43 | 'title': title, |
bbc9dc56 | 44 | 'duration': duration, |
e4039057 PH |
45 | 'view_count': view_count, |
46 | 'age_limit': 18, | |
ec870511 YCH |
47 | }) |
48 | ||
49 | return info_dict |