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

  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. class HentaiStigmaIE(InfoExtractor):
  5. _VALID_URL = r'^https?://hentai\.animestigma\.com/(?P<id>[^/]+)'
  6. _TEST = {
  7. 'url': 'http://hentai.animestigma.com/inyouchuu-etsu-bonus/',
  8. 'md5': '4e3d07422a68a4cc363d8f57c8bf0d23',
  9. 'info_dict': {
  10. 'id': 'inyouchuu-etsu-bonus',
  11. 'ext': 'mp4',
  12. "title": "Inyouchuu Etsu Bonus",
  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('id')
  19. webpage = self._download_webpage(url, video_id)
  20. title = self._html_search_regex(
  21. r'<h2 class="posttitle"><a[^>]*>([^<]+)</a>',
  22. webpage, 'title')
  23. wrap_url = self._html_search_regex(
  24. r'<iframe src="([^"]+mp4)"', webpage, 'wrapper url')
  25. wrap_webpage = self._download_webpage(wrap_url, video_id)
  26. video_url = self._html_search_regex(
  27. r'clip:\s*{\s*url: "([^"]*)"', wrap_webpage, 'video url')
  28. return {
  29. 'id': video_id,
  30. 'url': video_url,
  31. 'title': title,
  32. 'age_limit': 18,
  33. }