]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xvideos.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
11 class XVideosIE(InfoExtractor
):
12 _VALID_URL
= r
'^(?:https?://)?(?:www\.)?xvideos\.com/video([0-9]+)(?:.*)'
14 'url': 'http://www.xvideos.com/video939581/funny_porns_by_s_-1',
16 'md5': '1d0c835822f0a71a7bf011855db929d0',
18 "title": "Funny Porns By >>>>S<<<<<< -1",
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
25 video_id
= mobj
.group(1)
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 self
.report_extraction(video_id
)
32 video_url
= compat_urllib_parse
.unquote(
33 self
._search
_regex
(r
'flv_url=(.+?)&', webpage
, 'video URL'))
36 video_title
= self
._html
_search
_regex
(
37 r
'<title>(.*?)\s+-\s+XVID', webpage
, 'title')
39 # Extract video thumbnail
40 video_thumbnail
= self
._search
_regex
(
41 r
'url_bigthumb=(.+?)&', webpage
, 'thumbnail', fatal
=False)
50 'thumbnail': video_thumbnail
,