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.

43 lines
1.3 KiB

  1. import re
  2. from .common import InfoExtractor
  3. class HentaiStigmaIE(InfoExtractor):
  4. _VALID_URL = r'^https?://hentai\.animestigma\.com/(?P<videoid>[^/]+)'
  5. _TEST = {
  6. u'url': u'http://hentai.animestigma.com/inyouchuu-etsu-bonus/',
  7. u'file': u'inyouchuu-etsu-bonus.mp4',
  8. u'md5': u'4e3d07422a68a4cc363d8f57c8bf0d23',
  9. u'info_dict': {
  10. u"title": u"Inyouchuu Etsu Bonus",
  11. u"age_limit": 18,
  12. }
  13. }
  14. def _real_extract(self, url):
  15. mobj = re.match(self._VALID_URL, url)
  16. video_id = mobj.group('videoid')
  17. # Get webpage content
  18. webpage = self._download_webpage(url, video_id)
  19. # Get the video title
  20. video_title = self._html_search_regex(r'<h2 class="posttitle"><a[^>]*>([^<]+)</a>',
  21. webpage, u'title').strip()
  22. # Get the wrapper url
  23. wrap_url = self._html_search_regex(r'<iframe src="([^"]+mp4)"', webpage, u'wrapper url')
  24. # Get wrapper content
  25. wrap_webpage = self._download_webpage(wrap_url, video_id)
  26. video_url = self._html_search_regex(r'clip:\s*{\s*url: "([^"]*)"', wrap_webpage, u'video url')
  27. info = {'id': video_id,
  28. 'url': video_url,
  29. 'title': video_title,
  30. 'format': 'mp4',
  31. 'age_limit': 18}
  32. return [info]