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

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