]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xnxx.py
68acb84098fc0c2b9349ad6fd540d857fbcb5075
3 from .common
import InfoExtractor
11 class XNXXIE(InfoExtractor
):
12 _VALID_URL
= r
'^(?:https?://)?video\.xnxx\.com/video([0-9]+)/(.*)'
13 VIDEO_URL_RE
= r
'flv_url=(.*?)&'
14 VIDEO_TITLE_RE
= r
'<title>(.*?)\s+-\s+XNXX.COM'
15 VIDEO_THUMB_RE
= r
'url_bigthumb=(.*?)&'
17 def _real_extract(self
, url
):
18 mobj
= re
.match(self
._VALID
_URL
, url
)
20 raise ExtractorError(u
'Invalid URL: %s' % url
)
21 video_id
= mobj
.group(1)
24 webpage
= self
._download
_webpage
(url
, video_id
)
26 video_url
= self
._search
_regex
(self
.VIDEO_URL_RE
,
27 webpage
, u
'video URL')
28 video_url
= compat_urllib_parse
.unquote(video_url
)
30 video_title
= self
._html
_search
_regex
(self
.VIDEO_TITLE_RE
,
33 video_thumbnail
= self
._search
_regex
(self
.VIDEO_THUMB_RE
,
34 webpage
, u
'thumbnail', fatal
=False)
43 'thumbnail': video_thumbnail
,