summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-05-13 10:09:04 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-05-13 10:09:04 +0200
commit24e6ec8ac862267b100539fbe745ec87015bbc3d (patch)
treef45c809c55957955a0e78b1fbb8b081453b6ae58
parent87724af7a8a22d00199fbda75c5b99f336386fca (diff)
parent33c7ff861ec6288a6e437deb73a277067ac9e267 (diff)
downloadyoutube-dl-24e6ec8ac862267b100539fbe745ec87015bbc3d.tar.gz
youtube-dl-24e6ec8ac862267b100539fbe745ec87015bbc3d.tar.xz
youtube-dl-24e6ec8ac862267b100539fbe745ec87015bbc3d.zip
Merge remote-tracking branch 'hojel/hentaistigma'
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/hentaistigma.py43
2 files changed, 44 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 84a1830d0..3b10fc819 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -110,6 +110,7 @@ from .googleplus import GooglePlusIE
 from .googlesearch import GoogleSearchIE
 from .hark import HarkIE
 from .helsinki import HelsinkiIE
+from .hentaistigma import HentaiStigmaIE
 from .hotnewhiphop import HotNewHipHopIE
 from .howcast import HowcastIE
 from .huffpost import HuffPostIE
diff --git a/youtube_dl/extractor/hentaistigma.py b/youtube_dl/extractor/hentaistigma.py
new file mode 100644
index 000000000..4f2d30599
--- /dev/null
+++ b/youtube_dl/extractor/hentaistigma.py
@@ -0,0 +1,43 @@
+import re
+
+from .common import InfoExtractor
+
+class HentaiStigmaIE(InfoExtractor):
+    _VALID_URL = r'^https?://hentai\.animestigma\.com/(?P<videoid>[^/]+)'
+    _TEST = {
+        u'url': u'http://hentai.animestigma.com/inyouchuu-etsu-bonus/',
+        u'file': u'inyouchuu-etsu-bonus.mp4',
+        u'md5': u'4e3d07422a68a4cc363d8f57c8bf0d23',
+        u'info_dict': {
+            u"title": u"Inyouchuu Etsu Bonus",
+            u"age_limit": 18,
+        }
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+
+        video_id = mobj.group('videoid')
+
+        # Get webpage content
+        webpage = self._download_webpage(url, video_id)
+
+        # Get the video title
+        video_title = self._html_search_regex(r'<h2 class="posttitle"><a[^>]*>([^<]+)</a>',
+            webpage, u'title').strip()
+
+        # Get the wrapper url
+        wrap_url = self._html_search_regex(r'<iframe src="([^"]+mp4)"', webpage, u'wrapper url')
+
+        # Get wrapper content
+        wrap_webpage = self._download_webpage(wrap_url, video_id)
+
+        video_url = self._html_search_regex(r'clip:\s*{\s*url: "([^"]*)"', wrap_webpage, u'video url')
+
+        info = {'id': video_id,
+                'url': video_url,
+                'title': video_title,
+                'format': 'mp4',
+                'age_limit': 18}
+
+        return [info]