]>
Commit | Line | Data |
---|---|---|
a4a554a7 | 1 | from .common import InfoExtractor |
3d9fae1e | 2 | from ..utils import ( |
3d9fae1e PH |
3 | str_to_int, |
4 | ) | |
5 | ||
f4a3490c | 6 | |
a4a554a7 | 7 | class PornoXOIE(InfoExtractor): |
df773c3d | 8 | _WORKING = False |
3d9fae1e PH |
9 | _VALID_URL = r'https?://(?:www\.)?pornoxo\.com/videos/(?P<id>\d+)/(?P<display_id>[^/]+)\.html' |
10 | _TEST = { | |
11 | 'url': 'http://www.pornoxo.com/videos/7564/striptease-from-sexy-secretary.html', | |
12 | 'md5': '582f28ecbaa9e6e24cb90f50f524ce87', | |
13 | 'info_dict': { | |
14 | 'id': '7564', | |
15 | 'ext': 'flv', | |
16 | 'title': 'Striptease From Sexy Secretary!', | |
567a5996 DR |
17 | 'display_id': 'striptease-from-sexy-secretary', |
18 | 'description': 'md5:0ee35252b685b3883f4a1d38332f9980', | |
3d9fae1e | 19 | 'categories': list, # NSFW |
ec85ded8 | 20 | 'thumbnail': r're:https?://.*\.jpg$', |
3d9fae1e PH |
21 | 'age_limit': 18, |
22 | } | |
23 | } | |
24 | ||
25 | def _real_extract(self, url): | |
5ad28e7f | 26 | mobj = self._match_valid_url(url) |
567a5996 | 27 | video_id, display_id = mobj.groups() |
3d9fae1e PH |
28 | |
29 | webpage = self._download_webpage(url, video_id) | |
567a5996 | 30 | video_data = self._extract_jwplayer_data(webpage, video_id, require_title=False) |
3d9fae1e PH |
31 | |
32 | title = self._html_search_regex( | |
33 | r'<title>([^<]+)\s*-\s*PornoXO', webpage, 'title') | |
34 | ||
3d9fae1e | 35 | view_count = str_to_int(self._html_search_regex( |
f4a3490c | 36 | r'[vV]iews:\s*([0-9,]+)', webpage, 'view count', fatal=False)) |
3d9fae1e PH |
37 | |
38 | categories_str = self._html_search_regex( | |
39 | r'<meta name="description" content=".*featuring\s*([^"]+)"', | |
40 | webpage, 'categories', fatal=False) | |
41 | categories = ( | |
42 | None if categories_str is None | |
43 | else categories_str.split(',')) | |
44 | ||
567a5996 | 45 | video_data.update({ |
3d9fae1e | 46 | 'id': video_id, |
3d9fae1e | 47 | 'title': title, |
567a5996 DR |
48 | 'display_id': display_id, |
49 | 'description': self._html_search_meta('description', webpage), | |
3d9fae1e PH |
50 | 'categories': categories, |
51 | 'view_count': view_count, | |
52 | 'age_limit': 18, | |
567a5996 DR |
53 | }) |
54 | ||
55 | return video_data |