]>
Commit | Line | Data |
---|---|---|
bdebf51c JMF |
1 | # encoding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
570fa151 PH |
4 | import re |
5 | ||
6 | from .common import InfoExtractor | |
7 | from ..utils import ( | |
8 | compat_urllib_parse, | |
570fa151 PH |
9 | ) |
10 | ||
11 | ||
12 | class XNXXIE(InfoExtractor): | |
bdebf51c | 13 | _VALID_URL = r'^https?://(?:video|www)\.xnxx\.com/video(?P<id>[0-9]+)/(.*)' |
6f5ac90c | 14 | _TEST = { |
bdebf51c JMF |
15 | 'url': 'http://video.xnxx.com/video1135332/lida_naked_funny_actress_5_', |
16 | 'md5': '0831677e2b4761795f68d417e0b7b445', | |
17 | 'info_dict': { | |
18 | 'id': '1135332', | |
19 | 'ext': 'flv', | |
20 | 'title': 'lida » Naked Funny Actress (5)', | |
21 | 'age_limit': 18, | |
6f5ac90c PH |
22 | } |
23 | } | |
570fa151 PH |
24 | |
25 | def _real_extract(self, url): | |
26 | mobj = re.match(self._VALID_URL, url) | |
bdebf51c | 27 | video_id = mobj.group('id') |
570fa151 PH |
28 | |
29 | # Get webpage content | |
30 | webpage = self._download_webpage(url, video_id) | |
31 | ||
bdebf51c JMF |
32 | video_url = self._search_regex(r'flv_url=(.*?)&', |
33 | webpage, 'video URL') | |
570fa151 PH |
34 | video_url = compat_urllib_parse.unquote(video_url) |
35 | ||
bdebf51c JMF |
36 | video_title = self._html_search_regex(r'<title>(.*?)\s+-\s+XNXX.COM', |
37 | webpage, 'title') | |
570fa151 | 38 | |
bdebf51c JMF |
39 | video_thumbnail = self._search_regex(r'url_bigthumb=(.*?)&', |
40 | webpage, 'thumbnail', fatal=False) | |
570fa151 | 41 | |
bdebf51c | 42 | return { |
570fa151 PH |
43 | 'id': video_id, |
44 | 'url': video_url, | |
570fa151 PH |
45 | 'title': video_title, |
46 | 'ext': 'flv', | |
47 | 'thumbnail': video_thumbnail, | |
8e590a11 | 48 | 'age_limit': 18, |
bdebf51c | 49 | } |