1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
7 compat_urllib_parse_urlparse
,
16 class ExtremeTubeIE(InfoExtractor
):
17 _VALID_URL
= r
'https?://(?:www\.)?(?P<url>extremetube\.com/.*?video/.+?(?P<id>[0-9]+))(?:[/?&]|$)'
19 'url': 'http://www.extremetube.com/video/music-video-14-british-euro-brit-european-cumshots-swallow-652431',
20 'md5': '1fb9228f5e3332ec8c057d6ac36f33e0',
24 'title': 'Music Video 14 british euro brit european cumshots swallow',
25 'uploader': 'unknown',
30 'url': 'http://www.extremetube.com/gay/video/abcde-1234',
31 'only_matching': True,
34 def _real_extract(self
, url
):
35 mobj
= re
.match(self
._VALID
_URL
, url
)
36 video_id
= mobj
.group('id')
37 url
= 'http://www.' + mobj
.group('url')
39 req
= compat_urllib_request
.Request(url
)
40 req
.add_header('Cookie', 'age_verified=1')
41 webpage
= self
._download
_webpage
(req
, video_id
)
43 video_title
= self
._html
_search
_regex
(
44 r
'<h1 [^>]*?title="([^"]+)"[^>]*>', webpage
, 'title')
45 uploader
= self
._html
_search
_regex
(
46 r
'Uploaded by:\s*</strong>\s*(.+?)\s*</div>',
47 webpage
, 'uploader', fatal
=False)
48 view_count
= str_to_int(self
._html
_search
_regex
(
49 r
'Views:\s*</strong>\s*<span>([\d,\.]+)</span>',
50 webpage
, 'view count', fatal
=False))
52 video_url
= compat_urllib_parse
.unquote(self
._html
_search
_regex
(
53 r
'video_url=(.+?)&', webpage
, 'video_url'))
54 path
= compat_urllib_parse_urlparse(video_url
).path
55 format
= path
.split('/')[5].split('_')[:2]
56 format
= "-".join(format
)
62 'view_count': view_count
,