1 from __future__ import unicode_literals
3 from .common import InfoExtractor
4 from ..utils import ExtractorError
7 class RedTubeIE(InfoExtractor):
8 _VALID_URL = r'http://(?:www\.)?redtube\.com/(?P<id>[0-9]+)'
10 'url': 'http://www.redtube.com/66418',
14 "title": "Sucked on a toilet",
19 def _real_extract(self, url):
20 video_id = self._match_id(url)
21 webpage = self._download_webpage(url, video_id)
23 if any(s in webpage for s in ['video-deleted-info', '>This video has been removed']):
24 raise ExtractorError('Video %s has been removed' % video_id, expected=True)
26 video_url = self._html_search_regex(
27 r'<source src="(.+?)" type="video/mp4">', webpage, 'video URL')
28 video_title = self._html_search_regex(
29 r'<h1 class="videoTitle[^"]*">(.+?)</h1>',
31 video_thumbnail = self._og_search_thumbnail(webpage)
33 # No self-labeling, but they describe themselves as
34 # "Home of Videos Porno"
42 'thumbnail': video_thumbnail,
43 'age_limit': age_limit,