]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/youjizz.py
3 from .common
import InfoExtractor
9 class YouJizzIE(InfoExtractor
):
10 _VALID_URL
= r
'^(?:https?://)?(?:\w+\.)?youjizz\.com/videos/(?P<videoid>[^.]+).html$'
12 def _real_extract(self
, url
):
13 mobj
= re
.match(self
._VALID
_URL
, url
)
15 video_id
= mobj
.group('videoid')
18 webpage
= self
._download
_webpage
(url
, video_id
)
21 video_title
= self
._html
_search
_regex
(r
'<title>(?P<title>.*)</title>',
22 webpage
, u
'title').strip()
25 result
= re
.search(r
'https?://www.youjizz.com/videos/embed/(?P<videoid>[0-9]+)', webpage
)
27 raise ExtractorError(u
'ERROR: unable to extract embed page')
29 embed_page_url
= result
.group(0).strip()
30 video_id
= result
.group('videoid')
32 webpage
= self
._download
_webpage
(embed_page_url
, video_id
)
35 video_url
= self
._search
_regex
(r
'so.addVariable\("file",encodeURIComponent\("(?P<source>[^"]+)"\)\);',
36 webpage
, u
'video URL')
38 info
= {'id': video_id
,
43 'player_url': embed_page_url
}