]>
Commit | Line | Data |
---|---|---|
ab19b46b S |
1 | from ..utils import str_to_int |
2 | from .keezmovies import KeezMoviesIE | |
32a35e44 | 3 | |
32a35e44 | 4 | |
6368e2e6 | 5 | class ExtremeTubeIE(KeezMoviesIE): # XXX: Do not subclass from concrete IE |
b505e987 | 6 | _VALID_URL = r'https?://(?:www\.)?extremetube\.com/(?:[^/]+/)?video/(?P<id>[^/#?&]+)' |
52fadd5f | 7 | _TESTS = [{ |
3c50b99a | 8 | 'url': 'http://www.extremetube.com/video/music-video-14-british-euro-brit-european-cumshots-swallow-652431', |
d3179732 | 9 | 'md5': '92feaafa4b58e82f261e5419f39c60cb', |
3c50b99a | 10 | 'info_dict': { |
b505e987 | 11 | 'id': 'music-video-14-british-euro-brit-european-cumshots-swallow-652431', |
3c50b99a PH |
12 | 'ext': 'mp4', |
13 | 'title': 'Music Video 14 british euro brit european cumshots swallow', | |
d3179732 | 14 | 'uploader': 'anonim', |
2f9e8776 | 15 | 'view_count': int, |
3c50b99a | 16 | 'age_limit': 18, |
32a35e44 | 17 | } |
52fadd5f PH |
18 | }, { |
19 | 'url': 'http://www.extremetube.com/gay/video/abcde-1234', | |
20 | 'only_matching': True, | |
cc8034cc S |
21 | }, { |
22 | 'url': 'http://www.extremetube.com/video/latina-slut-fucked-by-fat-black-dick', | |
23 | 'only_matching': True, | |
24 | }, { | |
25 | 'url': 'http://www.extremetube.com/video/652431', | |
26 | 'only_matching': True, | |
52fadd5f | 27 | }] |
32a35e44 | 28 | |
29 | def _real_extract(self, url): | |
ab19b46b | 30 | webpage, info = self._extract_info(url) |
32a35e44 | 31 | |
ab19b46b S |
32 | if not info['title']: |
33 | info['title'] = self._search_regex( | |
34 | r'<h1[^>]+title="([^"]+)"[^>]*>', webpage, 'title') | |
32a35e44 | 35 | |
3c50b99a | 36 | uploader = self._html_search_regex( |
d3179732 | 37 | r'Uploaded by:\s*</[^>]+>\s*<a[^>]+>(.+?)</a>', |
2f9e8776 | 38 | webpage, 'uploader', fatal=False) |
ab19b46b | 39 | view_count = str_to_int(self._search_regex( |
d3179732 | 40 | r'Views:\s*</[^>]+>\s*<[^>]+>([\d,\.]+)</', |
2f9e8776 S |
41 | webpage, 'view count', fatal=False)) |
42 | ||
ab19b46b | 43 | info.update({ |
32a35e44 | 44 | 'uploader': uploader, |
2f9e8776 | 45 | 'view_count': view_count, |
ab19b46b S |
46 | }) |
47 | ||
48 | return info |