logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

extremetube.py (1747B)


  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': '92feaafa4b58e82f261e5419f39c60cb',
  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': 'anonim',
  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*</[^>]+>\s*<a[^>]+>(.+?)</a>',
  34. webpage, 'uploader', fatal=False)
  35. view_count = str_to_int(self._search_regex(
  36. r'Views:\s*</[^>]+>\s*<[^>]+>([\d,\.]+)</',
  37. webpage, 'view count', fatal=False))
  38. info.update({
  39. 'uploader': uploader,
  40. 'view_count': view_count,
  41. })
  42. return info