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.

42 lines
1.4 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. # encoding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..compat import compat_urllib_parse_unquote
  5. class XNXXIE(InfoExtractor):
  6. _VALID_URL = r'^https?://(?:video|www)\.xnxx\.com/video(?P<id>[0-9]+)/(.*)'
  7. _TEST = {
  8. 'url': 'http://video.xnxx.com/video1135332/lida_naked_funny_actress_5_',
  9. 'md5': '0831677e2b4761795f68d417e0b7b445',
  10. 'info_dict': {
  11. 'id': '1135332',
  12. 'ext': 'flv',
  13. 'title': 'lida » Naked Funny Actress (5)',
  14. 'age_limit': 18,
  15. }
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. video_url = self._search_regex(r'flv_url=(.*?)&amp;',
  21. webpage, 'video URL')
  22. video_url = compat_urllib_parse_unquote(video_url)
  23. video_title = self._html_search_regex(r'<title>(.*?)\s+-\s+XNXX.COM',
  24. webpage, 'title')
  25. video_thumbnail = self._search_regex(r'url_bigthumb=(.*?)&amp;',
  26. webpage, 'thumbnail', fatal=False)
  27. return {
  28. 'id': video_id,
  29. 'url': video_url,
  30. 'title': video_title,
  31. 'ext': 'flv',
  32. 'thumbnail': video_thumbnail,
  33. 'age_limit': 18,
  34. }