From 063761dcd8b6663e96f05a5f690e17ea7f6f8c4c Mon Sep 17 00:00:00 2001 From: JChris246 <43832407+JChris246@users.noreply.github.com> Date: Wed, 13 Mar 2019 21:49:53 +0000 Subject: [PATCH 1/3] Delete anysex.py --- youtube_dl/extractor/anysex.py | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 youtube_dl/extractor/anysex.py diff --git a/youtube_dl/extractor/anysex.py b/youtube_dl/extractor/anysex.py deleted file mode 100644 index ad86d6e58..000000000 --- a/youtube_dl/extractor/anysex.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import unicode_literals - -import re - -from .common import InfoExtractor -from ..utils import ( - parse_duration, - int_or_none, -) - - -class AnySexIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?anysex\.com/(?P\d+)' - _TEST = { - 'url': 'http://anysex.com/156592/', - 'md5': '023e9fbb7f7987f5529a394c34ad3d3d', - 'info_dict': { - 'id': '156592', - 'ext': 'mp4', - 'title': 'Busty and sexy blondie in her bikini strips for you', - 'description': 'md5:de9e418178e2931c10b62966474e1383', - 'categories': ['Erotic'], - 'duration': 270, - 'age_limit': 18, - } - } - - def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - - webpage = self._download_webpage(url, video_id) - - video_url = self._html_search_regex(r"video_url\s*:\s*'([^']+)'", webpage, 'video URL') - - title = self._html_search_regex(r'(.*?)', webpage, 'title') - description = self._html_search_regex( - r'
]*>([^<]+)
', webpage, 'description', fatal=False) - thumbnail = self._html_search_regex( - r'preview_url\s*:\s*\'(.*?)\'', webpage, 'thumbnail', fatal=False) - - categories = re.findall( - r'([^<]+)', webpage) - - duration = parse_duration(self._search_regex( - r'Duration: (?:)?(\d+:\d+)', webpage, 'duration', fatal=False)) - view_count = int_or_none(self._html_search_regex( - r'Views: (\d+)', webpage, 'view count', fatal=False)) - - return { - 'id': video_id, - 'url': video_url, - 'ext': 'mp4', - 'title': title, - 'description': description, - 'thumbnail': thumbnail, - 'categories': categories, - 'duration': duration, - 'view_count': view_count, - 'age_limit': 18, - } From 685e9619235c272fec8d3868e3d851b44a67d78b Mon Sep 17 00:00:00 2001 From: JChris246 Date: Wed, 13 Mar 2019 21:10:10 -0400 Subject: [PATCH 2/3] [Anysex] removed extractor to be handled by generic extractor anysex video urls are in html5 video tags which can be extracted by generic extractor Adjusted common.py to be able to sort formats founf from anysex --- youtube_dl/extractor/common.py | 2 +- youtube_dl/extractor/extractors.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index dfd0584d3..01dc22b4c 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -2483,7 +2483,7 @@ class InfoExtractor(object): # in the wild f.update({ 'height': int_or_none(source_attributes.get('res')), - 'format_id': source_attributes.get('label'), + 'format_id': source_attributes.get('label') or source_attributes.get('title'), }) f.update(formats[0]) media_info['formats'].append(f) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 9a0459de8..e27a09509 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -39,7 +39,6 @@ from .amcnetworks import AMCNetworksIE from .americastestkitchen import AmericasTestKitchenIE from .animeondemand import AnimeOnDemandIE from .anvato import AnvatoIE -from .anysex import AnySexIE from .aol import AolIE from .allocine import AllocineIE from .aliexpress import AliExpressLiveIE From 28051dd8edc8391c55bc452d9bda626ea462bc8c Mon Sep 17 00:00:00 2001 From: Sergey M Date: Sun, 17 Mar 2019 09:12:06 +0700 Subject: [PATCH 3/3] Update common.py --- youtube_dl/extractor/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 01dc22b4c..dfd0584d3 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -2483,7 +2483,7 @@ class InfoExtractor(object): # in the wild f.update({ 'height': int_or_none(source_attributes.get('res')), - 'format_id': source_attributes.get('label') or source_attributes.get('title'), + 'format_id': source_attributes.get('label'), }) f.update(formats[0]) media_info['formats'].append(f)