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", 
  24     def _real_extract(self
, url
): 
  25         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  26         video_id 
= mobj
.group('videoid') 
  27         url 
= 'http://www.' + mobj
.group('url') 
  29         req 
= compat_urllib_request
.Request(url
) 
  30         req
.add_header('Cookie', 'age_verified=1') 
  31         webpage 
= self
._download
_webpage
(req
, video_id
) 
  33         video_title 
= self
._html
_search
_regex
(r
'<h1 [^>]*?title="([^"]+)"[^>]*>\1<', webpage
, u
'title') 
  34         uploader 
= self
._html
_search
_regex
(r
'>Posted by:(?=<)(?:\s|<[^>]*>)*(.+?)\|', webpage
, u
'uploader', fatal
=False) 
  35         video_url 
= compat_urllib_parse
.unquote(self
._html
_search
_regex
(r
'video_url=(.+?)&', webpage
, u
'video_url')) 
  36         path 
= compat_urllib_parse_urlparse(video_url
).path
 
  37         extension 
= os
.path
.splitext(path
)[1][1:] 
  38         format 
= path
.split('/')[5].split('_')[:2] 
  39         format 
= "-".join(format
)