From 54725c9f0b30629a961314251574d05360cf5772 Mon Sep 17 00:00:00 2001 From: Simon Morgan Date: Fri, 14 Oct 2016 17:38:31 +0100 Subject: [PATCH] [gotporn] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/gotporn.py | 43 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 youtube_dl/extractor/gotporn.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 08bed8b0c..ca5b8d45b 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -345,6 +345,7 @@ from .googledrive import GoogleDriveIE from .googleplus import GooglePlusIE from .googlesearch import GoogleSearchIE from .goshgay import GoshgayIE +from .gotporn import GotPornIE from .gputechconf import GPUTechConfIE from .groupon import GrouponIE from .hark import HarkIE diff --git a/youtube_dl/extractor/gotporn.py b/youtube_dl/extractor/gotporn.py new file mode 100644 index 000000000..a9e267842 --- /dev/null +++ b/youtube_dl/extractor/gotporn.py @@ -0,0 +1,43 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..utils import determine_ext + +class GotPornIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?xvideos\.com/video(?P[0-9]+)(?:.*)' + _VALID_URL = r'http://www\.gotporn\.com/(?P[^/]+)/video-(?P[0-9]+)' + _TEST = { + 'url': 'http://www.gotporn.com/big-boobs-babe/video-5661549', + 'md5': '9ad371d58a8ee709d8321a548d6e5d2d', + 'info_dict': { + 'id': '5661549', + 'ext': 'mp4', + 'title': 'Big Boobs Babe', + 'age_limit': 18, + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + display_id = mobj.group('display_id') + if not display_id: + display_id = video_id + + webpage = self._download_webpage(url, video_id) + + title = self._html_search_regex(r'\s*([^<]+)', webpage, 'title') + thumbnail_url = self._html_search_regex(r'