]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/pornotube.py
35dc5a9ffafb32d36e30f51988291dded6a6d18c
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",
24 def _real_extract(self
, url
):
25 mobj
= re
.match(self
._VALID
_URL
, url
)
27 video_id
= mobj
.group('videoid')
28 video_title
= mobj
.group('title')
31 webpage
= self
._download
_webpage
(url
, video_id
)
34 VIDEO_URL_RE
= r
'url: "(?P<url>http://video[0-9].pornotube.com/.+\.flv)",'
35 video_url
= self
._search
_regex
(VIDEO_URL_RE
, webpage
, u
'video url')
36 video_url
= compat_urllib_parse
.unquote(video_url
)
38 #Get the uploaded date
39 VIDEO_UPLOADED_RE
= r
'<div class="video_added_by">Added (?P<date>[0-9\/]+) by'
40 upload_date
= self
._html
_search
_regex
(VIDEO_UPLOADED_RE
, webpage
, u
'upload date', fatal
=False)
41 if upload_date
: upload_date
= unified_strdate(upload_date
)
42 age_limit
= self
._rta
_search
(webpage
)
44 info
= {'id': video_id
,
47 'upload_date': upload_date
,
51 'age_limit': age_limit
}