4 from .common import InfoExtractor
6 compat_urllib_parse_urlparse,
11 class ExtremeTubeIE(InfoExtractor):
12 _VALID_URL = r'^(?:https?://)?(?:www\.)?(?P<url>extremetube\.com/.*?video/.+?(?P<videoid>[0-9]+))(?:[/?&]|$)'
14 u'url': u'http://www.extremetube.com/video/music-video-14-british-euro-brit-european-cumshots-swallow-652431',
15 u'file': u'652431.mp4',
16 u'md5': u'1fb9228f5e3332ec8c057d6ac36f33e0',
18 u"title": u"Music Video 14 british euro brit european cumshots swallow",
19 u"uploader": u"unknown",
23 'url': 'http://www.extremetube.com/gay/video/abcde-1234',
24 'only_matching': True,
27 def _real_extract(self, url):
28 mobj = re.match(self._VALID_URL, url)
29 video_id = mobj.group('videoid')
30 url = 'http://www.' + mobj.group('url')
32 req = compat_urllib_request.Request(url)
33 req.add_header('Cookie', 'age_verified=1')
34 webpage = self._download_webpage(req, video_id)
36 video_title = self._html_search_regex(r'<h1 [^>]*?title="([^"]+)"[^>]*>\1<', webpage, u'title')
37 uploader = self._html_search_regex(r'>Posted by:(?=<)(?:\s|<[^>]*>)*(.+?)\|', webpage, u'uploader', fatal=False)
38 video_url = compat_urllib_parse.unquote(self._html_search_regex(r'video_url=(.+?)&', webpage, u'video_url'))
39 path = compat_urllib_parse_urlparse(video_url).path
40 extension = os.path.splitext(path)[1][1:]
41 format = path.split('/')[5].split('_')[:2]
42 format = "-".join(format)