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.

38 lines
1.1 KiB

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