]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/pornotube.py
5253aa3d30062ec7937c5e5f48d85998923c6e8f
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
13 class PornotubeIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:\w+\.)?pornotube\.com(/c/(?P<channel>[0-9]+))?(/m/(?P<videoid>[0-9]+))(/(?P<title>.+))$'
16 'url': 'http://pornotube.com/c/173/m/1689755/Marilyn-Monroe-Bathing',
17 'md5': '374dd6dcedd24234453b295209aa69b6',
21 'upload_date': '20090708',
22 'title': 'Marilyn-Monroe-Bathing',
27 def _real_extract(self
, url
):
28 mobj
= re
.match(self
._VALID
_URL
, url
)
30 video_id
= mobj
.group('videoid')
31 video_title
= mobj
.group('title')
34 webpage
= self
._download
_webpage
(url
, video_id
)
37 VIDEO_URL_RE
= r
'url: "(?P<url>http://video[0-9].pornotube.com/.+\.flv)",'
38 video_url
= self
._search
_regex
(VIDEO_URL_RE
, webpage
, 'video url')
39 video_url
= compat_urllib_parse
.unquote(video_url
)
41 # Get the uploaded date
42 VIDEO_UPLOADED_RE
= r
'<div class="video_added_by">Added (?P<date>[0-9\/]+) by'
43 upload_date
= self
._html
_search
_regex
(VIDEO_UPLOADED_RE
, webpage
, 'upload date', fatal
=False)
45 upload_date
= unified_strdate(upload_date
)
46 age_limit
= self
._rta
_search
(webpage
)
51 'upload_date': upload_date
,
55 'age_limit': age_limit
,