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.

40 lines
1.2 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class RedTubeIE(InfoExtractor):
  4. _VALID_URL = r'http://(?:www\.)?redtube\.com/(?P<id>[0-9]+)'
  5. _TEST = {
  6. 'url': 'http://www.redtube.com/66418',
  7. 'info_dict': {
  8. 'id': '66418',
  9. 'ext': 'mp4',
  10. "title": "Sucked on a toilet",
  11. "age_limit": 18,
  12. }
  13. }
  14. def _real_extract(self, url):
  15. video_id = self._match_id(url)
  16. webpage = self._download_webpage(url, video_id)
  17. video_url = self._html_search_regex(
  18. r'<source src="(.+?)" type="video/mp4">', webpage, 'video URL')
  19. video_title = self._html_search_regex(
  20. r'<h1 class="videoTitle[^"]*">(.+?)</h1>',
  21. webpage, 'title')
  22. video_thumbnail = self._og_search_thumbnail(webpage)
  23. # No self-labeling, but they describe themselves as
  24. # "Home of Videos Porno"
  25. age_limit = 18
  26. return {
  27. 'id': video_id,
  28. 'url': video_url,
  29. 'ext': 'mp4',
  30. 'title': video_title,
  31. 'thumbnail': video_thumbnail,
  32. 'age_limit': age_limit,
  33. }