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