]>
Commit | Line | Data |
---|---|---|
6a1c4fbf | 1 | from .common import InfoExtractor |
355e4146 | 2 | from ..utils import ( |
73453430 S |
3 | int_or_none, |
4 | merge_dicts, | |
355e4146 | 5 | remove_end, |
73453430 | 6 | unified_timestamp, |
355e4146 | 7 | ) |
6a1c4fbf | 8 | |
513fd2a8 | 9 | |
6a1c4fbf | 10 | class HellPornoIE(InfoExtractor): |
868630fb AS |
11 | _VALID_URL = r'https?://(?:www\.)?hellporno\.(?:com/videos|net/v)/(?P<id>[^/]+)' |
12 | _TESTS = [{ | |
6a1c4fbf | 13 | 'url': 'http://hellporno.com/videos/dixie-is-posing-with-naked-ass-very-erotic/', |
73453430 | 14 | 'md5': 'f0a46ebc0bed0c72ae8fe4629f7de5f3', |
6a1c4fbf | 15 | 'info_dict': { |
16 | 'id': '149116', | |
513fd2a8 | 17 | 'display_id': 'dixie-is-posing-with-naked-ass-very-erotic', |
6a1c4fbf | 18 | 'ext': 'mp4', |
19 | 'title': 'Dixie is posing with naked ass very erotic', | |
73453430 S |
20 | 'description': 'md5:9a72922749354edb1c4b6e540ad3d215', |
21 | 'categories': list, | |
ec85ded8 | 22 | 'thumbnail': r're:https?://.*\.jpg$', |
73453430 S |
23 | 'duration': 240, |
24 | 'timestamp': 1398762720, | |
25 | 'upload_date': '20140429', | |
26 | 'view_count': int, | |
6a1c4fbf | 27 | 'age_limit': 18, |
73453430 | 28 | }, |
868630fb AS |
29 | }, { |
30 | 'url': 'http://hellporno.net/v/186271/', | |
31 | 'only_matching': True, | |
32 | }] | |
6a1c4fbf | 33 | |
34 | def _real_extract(self, url): | |
513fd2a8 | 35 | display_id = self._match_id(url) |
6a1c4fbf | 36 | |
355e4146 | 37 | webpage = self._download_webpage(url, display_id) |
6a1c4fbf | 38 | |
04f3fd2c | 39 | title = remove_end(self._html_extract_title(webpage), ' - Hell Porno') |
6a1c4fbf | 40 | |
73453430 S |
41 | info = self._parse_html5_media_entries(url, webpage, display_id)[0] |
42 | self._sort_formats(info['formats']) | |
6a1c4fbf | 43 | |
73453430 S |
44 | video_id = self._search_regex( |
45 | (r'chs_object\s*=\s*["\'](\d+)', | |
46 | r'params\[["\']video_id["\']\]\s*=\s*(\d+)'), webpage, 'video id', | |
47 | default=display_id) | |
48 | description = self._search_regex( | |
49 | r'class=["\']desc_video_view_v2[^>]+>([^<]+)', webpage, | |
50 | 'description', fatal=False) | |
51 | categories = [ | |
52 | c.strip() | |
53 | for c in self._html_search_meta( | |
54 | 'keywords', webpage, 'categories', default='').split(',') | |
55 | if c.strip()] | |
56 | duration = int_or_none(self._og_search_property( | |
57 | 'video:duration', webpage, fatal=False)) | |
58 | timestamp = unified_timestamp(self._og_search_property( | |
59 | 'video:release_date', webpage, fatal=False)) | |
60 | view_count = int_or_none(self._search_regex( | |
61 | r'>Views\s+(\d+)', webpage, 'view count', fatal=False)) | |
6a1c4fbf | 62 | |
73453430 | 63 | return merge_dicts(info, { |
6a1c4fbf | 64 | 'id': video_id, |
513fd2a8 | 65 | 'display_id': display_id, |
6a1c4fbf | 66 | 'title': title, |
73453430 | 67 | 'description': description, |
6a1c4fbf | 68 | 'categories': categories, |
73453430 S |
69 | 'duration': duration, |
70 | 'timestamp': timestamp, | |
71 | 'view_count': view_count, | |
6a1c4fbf | 72 | 'age_limit': 18, |
73453430 | 73 | }) |