]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/pornotube.py
3 from .common
import InfoExtractor
11 class PornotubeIE(InfoExtractor
):
12 _VALID_URL
= r
'^(?:https?://)?(?:\w+\.)?pornotube\.com(/c/(?P<channel>[0-9]+))?(/m/(?P<videoid>[0-9]+))(/(?P<title>.+))$'
14 u
'url': u
'http://pornotube.com/c/173/m/1689755/Marilyn-Monroe-Bathing',
15 u
'file': u
'1689755.flv',
16 u
'md5': u
'374dd6dcedd24234453b295209aa69b6',
18 u
"upload_date": u
"20090708",
19 u
"title": u
"Marilyn-Monroe-Bathing"
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
26 video_id
= mobj
.group('videoid')
27 video_title
= mobj
.group('title')
30 webpage
= self
._download
_webpage
(url
, video_id
)
33 VIDEO_URL_RE
= r
'url: "(?P<url>http://video[0-9].pornotube.com/.+\.flv)",'
34 video_url
= self
._search
_regex
(VIDEO_URL_RE
, webpage
, u
'video url')
35 video_url
= compat_urllib_parse
.unquote(video_url
)
37 #Get the uploaded date
38 VIDEO_UPLOADED_RE
= r
'<div class="video_added_by">Added (?P<date>[0-9\/]+) by'
39 upload_date
= self
._html
_search
_regex
(VIDEO_UPLOADED_RE
, webpage
, u
'upload date', fatal
=False)
40 if upload_date
: upload_date
= unified_strdate(upload_date
)
42 info
= {'id': video_id
,
45 'upload_date': upload_date
,