logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

hentaistigma.py (1201B)


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