From 8e05c870b4650599acfa35050df0ba7143bbe6ad Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 13 Dec 2013 22:22:53 -0500 Subject: [PATCH] Add support for pornhd.com. --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/pornhd.py | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 youtube_dl/extractor/pornhd.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 1149dc1ec..bd16f0f3e 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -111,6 +111,7 @@ from .orf import ORFIE from .pbs import PBSIE from .photobucket import PhotobucketIE from .podomatic import PodomaticIE +from .pornhd import PornHdIE from .pornhub import PornHubIE from .pornotube import PornotubeIE from .pyvideo import PyvideoIE 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[0-9]+)/(?P.+)' + _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, + }