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.

44 lines
1.3 KiB

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