]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xvideos.py
3 from .common
import InfoExtractor
9 class XVideosIE(InfoExtractor
):
10 _VALID_URL
= r
'^(?:https?://)?(?:www\.)?xvideos\.com/video([0-9]+)(?:.*)'
12 def _real_extract(self
, url
):
13 mobj
= re
.match(self
._VALID
_URL
, url
)
14 video_id
= mobj
.group(1)
16 webpage
= self
._download
_webpage
(url
, video_id
)
18 self
.report_extraction(video_id
)
21 video_url
= compat_urllib_parse
.unquote(self
._search
_regex
(r
'flv_url=(.+?)&',
22 webpage
, u
'video URL'))
25 video_title
= self
._html
_search
_regex
(r
'<title>(.*?)\s+-\s+XVID',
28 # Extract video thumbnail
29 video_thumbnail
= self
._search
_regex
(r
'http://(?:img.*?\.)xvideos.com/videos/thumbs/[a-fA-F0-9]+/[a-fA-F0-9]+/[a-fA-F0-9]+/[a-fA-F0-9]+/([a-fA-F0-9.]+jpg)',
30 webpage
, u
'thumbnail', fatal
=False)
39 'thumbnail': video_thumbnail
,