aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/pornhd.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-16 05:07:58 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-16 05:07:58 +0100
commit1bb2fc98e05b7cc556aa63aa226b5349e8a39159 (patch)
treee1e7a5f0647ccbc25fd9ed62d5f2c1c6fb81685c /youtube_dl/extractor/pornhd.py
parente3946f989ea53c14fb7ae0afd29f80a74512a3a3 (diff)
parent8e05c870b4650599acfa35050df0ba7143bbe6ad (diff)
Merge remote-tracking branch 'mjorlitzky/master'
Diffstat (limited to 'youtube_dl/extractor/pornhd.py')
-rw-r--r--youtube_dl/extractor/pornhd.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py
new file mode 100644
index 000000000..c56740b8a
--- /dev/null
+++ b/youtube_dl/extractor/pornhd.py
@@ -0,0 +1,42 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import compat_urllib_parse
+
+class PornHdIE(InfoExtractor):
+ _VALID_URL = r'(?:http://)?(?:www\.)?pornhd\.com/videos/(?P<video_id>[0-9]+)/(?P<video_title>.+)'
+ _TEST = {
+ u'id': u'1962',
+ u'url': u'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
+ u'md5': u'4fe06e5108e8b524c35896f4c54c7155',
+ u'info_dict': {
+ u"title": u"sierra-day-gets-his-cum-all-over-herself-hd-porn-video",
+ u"age_limit": 18,
+ }
+ }
+
+ def _real_extract(self, url):
+ mobj = re.match(self._VALID_URL, url)
+
+ video_id = mobj.group('video_id')
+ video_title = mobj.group('video_title')
+ video_extension = 'flv'
+
+ webpage = self._download_webpage(url, video_id)
+
+
+ self.report_extraction(video_id)
+
+ video_url = self._html_search_regex(
+ r'&hd=(http.+?)&', webpage, u'video URL')
+ video_url = compat_urllib_parse.unquote(video_url)
+
+ age_limit = 18
+
+ return {
+ 'id': video_id,
+ 'url': video_url,
+ 'ext': video_extension,
+ 'title': video_title,
+ 'age_limit': age_limit,
+ }