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

10 years ago
11 years ago
10 years ago
10 years ago
11 years ago
  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. from ..utils import compat_urllib_parse
  5. class PornHdIE(InfoExtractor):
  6. _VALID_URL = r'(?:http://)?(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<video_id>[0-9]+)/(?P<video_title>.+)'
  7. _TEST = {
  8. 'url': 'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
  9. 'file': '1962.flv',
  10. 'md5': '35272469887dca97abd30abecc6cdf75',
  11. 'info_dict': {
  12. "title": "sierra-day-gets-his-cum-all-over-herself-hd-porn-video",
  13. "age_limit": 18,
  14. }
  15. }
  16. def _real_extract(self, url):
  17. mobj = re.match(self._VALID_URL, url)
  18. video_id = mobj.group('video_id')
  19. video_title = mobj.group('video_title')
  20. webpage = self._download_webpage(url, video_id)
  21. next_url = self._html_search_regex(
  22. r'&hd=(http.+?)&', webpage, 'video URL')
  23. next_url = compat_urllib_parse.unquote(next_url)
  24. video_url = self._download_webpage(
  25. next_url, video_id, note='Retrieving video URL',
  26. errnote='Could not retrieve video URL')
  27. age_limit = 18
  28. return {
  29. 'id': video_id,
  30. 'url': video_url,
  31. 'ext': 'flv',
  32. 'title': video_title,
  33. 'age_limit': age_limit,
  34. }