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.

47 lines
1.4 KiB

  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. from ..utils import (
  5. ExtractorError,
  6. )
  7. class SlutloadIE(InfoExtractor):
  8. _VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P<id>[^/]+)/?$'
  9. _TEST = {
  10. 'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/',
  11. 'md5': '0cf531ae8006b530bd9df947a6a0df77',
  12. 'info_dict': {
  13. 'id': 'TD73btpBqSxc',
  14. 'ext': 'mp4',
  15. "title": "virginie baisee en cam",
  16. "age_limit": 18,
  17. 'thumbnail': 're:https?://.*?\.jpg'
  18. }
  19. }
  20. def _real_extract(self, url):
  21. mobj = re.match(self._VALID_URL, url)
  22. video_id = mobj.group('id')
  23. webpage = self._download_webpage(url, video_id)
  24. video_title = self._html_search_regex(r'<h1><strong>([^<]+)</strong>',
  25. webpage, 'title').strip()
  26. video_url = self._html_search_regex(
  27. r'(?s)<div id="vidPlayer"\s+data-url="([^"]+)"',
  28. webpage, 'video URL')
  29. thumbnail = self._html_search_regex(
  30. r'(?s)<div id="vidPlayer"\s+.*?previewer-file="([^"]+)"',
  31. webpage, 'thumbnail', fatal=False)
  32. return {
  33. 'id': video_id,
  34. 'url': video_url,
  35. 'title': video_title,
  36. 'thumbnail': thumbnail,
  37. 'age_limit': 18
  38. }