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.5 KiB

  1. from __future__ import unicode_literals
  2. from .nuevo import NuevoBaseIE
  3. class RulePornIE(NuevoBaseIE):
  4. _VALID_URL = r'https?://(?:www\.)?ruleporn\.com/(?:[^/?#&]+/)*(?P<id>[^/?#&]+)'
  5. _TEST = {
  6. 'url': 'http://ruleporn.com/brunette-nympho-chick-takes-her-boyfriend-in-every-angle/',
  7. 'md5': '86861ebc624a1097c7c10eaf06d7d505',
  8. 'info_dict': {
  9. 'id': '48212',
  10. 'display_id': 'brunette-nympho-chick-takes-her-boyfriend-in-every-angle',
  11. 'ext': 'mp4',
  12. 'title': 'Brunette Nympho Chick Takes Her Boyfriend In Every Angle',
  13. 'description': 'md5:6d28be231b981fff1981deaaa03a04d5',
  14. 'age_limit': 18,
  15. 'duration': 635.1,
  16. }
  17. }
  18. def _real_extract(self, url):
  19. display_id = self._match_id(url)
  20. webpage = self._download_webpage(url, display_id)
  21. video_id = self._search_regex(
  22. r'lovehomeporn\.com/embed/(\d+)', webpage, 'video id')
  23. title = self._search_regex(
  24. r'<h2[^>]+title=(["\'])(?P<url>.+?)\1',
  25. webpage, 'title', group='url')
  26. description = self._html_search_meta('description', webpage)
  27. info = self._extract_nuevo(
  28. 'http://lovehomeporn.com/media/nuevo/econfig.php?key=%s&rp=true' % video_id,
  29. video_id)
  30. info.update({
  31. 'display_id': display_id,
  32. 'title': title,
  33. 'description': description,
  34. 'age_limit': 18
  35. })
  36. return info