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 def _real_extract(self, url):
15 mobj = re.match(self._VALID_URL, url)
17 video_id = mobj.group('videoid')
18 video_title = mobj.group('title')
21 webpage = self._download_webpage(url, video_id)
24 VIDEO_URL_RE = r'url: "(?P<url>http://video[0-9].pornotube.com/.+\.flv)",'
25 video_url = self._search_regex(VIDEO_URL_RE, webpage, u'video url')
26 video_url = compat_urllib_parse.unquote(video_url)
28 #Get the uploaded date
29 VIDEO_UPLOADED_RE = r'<div class="video_added_by">Added (?P<date>[0-9\/]+) by'
30 upload_date = self._html_search_regex(VIDEO_UPLOADED_RE, webpage, u'upload date', fatal=False)
31 if upload_date: upload_date = unified_strdate(upload_date)
33 info = {'id': video_id,
36 'upload_date': upload_date,