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.

45 lines
1.4 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class EroProfileIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
  5. _TEST = {
  6. 'url': 'http://www.eroprofile.com/m/videos/view/sexy-babe-softcore',
  7. 'md5': 'c26f351332edf23e1ea28ce9ec9de32f',
  8. 'info_dict': {
  9. 'id': '3733775',
  10. 'display_id': 'sexy-babe-softcore',
  11. 'ext': 'm4v',
  12. 'title': 'sexy babe softcore',
  13. 'thumbnail': 're:https?://.*\.jpg',
  14. 'age_limit': 18,
  15. }
  16. }
  17. def _real_extract(self, url):
  18. display_id = self._match_id(url)
  19. webpage = self._download_webpage(url, display_id)
  20. video_id = self._search_regex(
  21. [r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
  22. webpage, 'video id', default=None)
  23. video_url = self._search_regex(
  24. r'<source src="([^"]+)', webpage, 'video url')
  25. title = self._html_search_regex(
  26. r'Title:</th><td>([^<]+)</td>', webpage, 'title')
  27. thumbnail = self._search_regex(
  28. r'onclick="showVideoPlayer\(\)"><img src="([^"]+)',
  29. webpage, 'thumbnail', fatal=False)
  30. return {
  31. 'id': video_id,
  32. 'display_id': display_id,
  33. 'url': video_url,
  34. 'title': title,
  35. 'thumbnail': thumbnail,
  36. 'age_limit': 18,
  37. }