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