You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

  1. from __future__ import unicode_literals
  2. from ..utils import str_to_int
  3. from .keezmovies import KeezMoviesIE
  4. class ExtremeTubeIE(KeezMoviesIE):
  5. _VALID_URL = r'https?://(?:www\.)?extremetube\.com/(?:[^/]+/)?video/(?P<id>[^/#?&]+)'
  6. _TESTS = [{
  7. 'url': 'http://www.extremetube.com/video/music-video-14-british-euro-brit-european-cumshots-swallow-652431',
  8. 'md5': '1fb9228f5e3332ec8c057d6ac36f33e0',
  9. 'info_dict': {
  10. 'id': 'music-video-14-british-euro-brit-european-cumshots-swallow-652431',
  11. 'ext': 'mp4',
  12. 'title': 'Music Video 14 british euro brit european cumshots swallow',
  13. 'uploader': 'unknown',
  14. 'view_count': int,
  15. 'age_limit': 18,
  16. }
  17. }, {
  18. 'url': 'http://www.extremetube.com/gay/video/abcde-1234',
  19. 'only_matching': True,
  20. }, {
  21. 'url': 'http://www.extremetube.com/video/latina-slut-fucked-by-fat-black-dick',
  22. 'only_matching': True,
  23. }, {
  24. 'url': 'http://www.extremetube.com/video/652431',
  25. 'only_matching': True,
  26. }]
  27. def _real_extract(self, url):
  28. webpage, info = self._extract_info(url)
  29. if not info['title']:
  30. info['title'] = self._search_regex(
  31. r'<h1[^>]+title="([^"]+)"[^>]*>', webpage, 'title')
  32. uploader = self._html_search_regex(
  33. r'Uploaded by:\s*</strong>\s*(.+?)\s*</div>',
  34. webpage, 'uploader', fatal=False)
  35. view_count = str_to_int(self._search_regex(
  36. r'Views:\s*</strong>\s*<span>([\d,\.]+)</span>',
  37. webpage, 'view count', fatal=False))
  38. info.update({
  39. 'uploader': uploader,
  40. 'view_count': view_count,
  41. })
  42. return info