From 9ba923dfecac861a1339dd1f5f2e7ab90c36a4a8 Mon Sep 17 00:00:00 2001 From: JChris246 Date: Tue, 29 Jan 2019 15:57:32 -0400 Subject: [PATCH] [cumlouder] Add new extractor --- youtube_dl/extractor/cumlouder.py | 64 ++++++++++++++++++++++++++++++ youtube_dl/extractor/extractors.py | 1 + 2 files changed, 65 insertions(+) create mode 100644 youtube_dl/extractor/cumlouder.py diff --git a/youtube_dl/extractor/cumlouder.py b/youtube_dl/extractor/cumlouder.py new file mode 100644 index 000000000..711ccc2af --- /dev/null +++ b/youtube_dl/extractor/cumlouder.py @@ -0,0 +1,64 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..utils import ( + parse_duration, + str_to_int, +) + +import re + + +class CumlouderIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?cumlouder\.com/porn-video/(?P[^/]+)/?' + _TEST = { + 'url': 'https://www.cumlouder.com/porn-video/jasmine-black-s-100-natural-tits/', + 'md5': 'cd893aaaace8c4ce7b33fc341c2f5fcf', + 'info_dict': { + 'id': 'jasmine-black-s-100-natural-tits', + 'ext': 'mp4', + 'title': 'Jasmine Black's 100% Natural Tits', + 'thumbnail': r're:^https?://.*\.jpg$', + 'age_limit': 18, + 'description': 'Cumlouder recommends Jasmine Black because, if you want to take care of yourself, ' + 'there's nothing better than a nice pair of 100-percent natural titties. Nick Moreno ' + 'is ready to enjoy the completely-free-of-artificial-additives boobs of Romanian star ' + 'Jasmine Black.', + 'duration': 607 + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + title = self._search_regex(r'

]+>(.+)

', webpage, 'title').strip() + + thumbnail = self._search_regex(r']+poster=\'(https?://.+\.jpg)', webpage, 'thumbnail') + + video_url = "https:" + self._search_regex(r']+src=["\'](//[^("\')]+)', webpage, 'video_url')\ + .replace("&", "&") + + description = self._search_regex(r'Description:([^<]+)', webpage, 'description').strip() + + view_count = str_to_int(self._search_regex(r'Views:\s+([\d]+)', webpage, 'view_count', default=None)) + + tags = [] + for mobj in re.finditer(r']+class=(["\'])tag-link\1[^>]*title=\1(?P[^\'"]+)\1', webpage): + tags.append(mobj.group('tag')) + + duration = parse_duration(self._search_regex( + r']+class=["\'][^>]*ico-duracion[^>]+>\s*([0-9:]+)', webpage, 'duration', + default=None)) + + return { + 'id': video_id, + 'url': video_url, + 'title': title, + 'thumbnail': thumbnail, + 'age_limit': 18, + 'description': description, + 'view_count': view_count, + 'tags': tags, + 'duration': duration + } diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index b40be42e6..b480cc75b 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -246,6 +246,7 @@ from .cspan import CSpanIE from .ctsnews import CtsNewsIE from .ctvnews import CTVNewsIE from .cultureunplugged import CultureUnpluggedIE +from .cumlouder import CumlouderIE from .curiositystream import ( CuriosityStreamIE, CuriosityStreamCollectionIE,