From ceb030a1ebce4707f69572a1614587884d785030 Mon Sep 17 00:00:00 2001 From: Andy Savicki Date: Sun, 20 Nov 2016 02:12:22 +0300 Subject: [PATCH 1/2] [hellporno] Add extraction for .net zone, fix tests (wrong extension) --- youtube_dl/extractor/hellporno.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/hellporno.py b/youtube_dl/extractor/hellporno.py index 7a1c75b65..abe18696a 100644 --- a/youtube_dl/extractor/hellporno.py +++ b/youtube_dl/extractor/hellporno.py @@ -10,8 +10,8 @@ from ..utils import ( class HellPornoIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?hellporno\.com/videos/(?P[^/]+)' - _TEST = { + _VALID_URL = r'https?://(?:www\.)?hellporno\.((com/videos)|(net/v))/(?P[^/]+)' + _TESTS = [{ 'url': 'http://hellporno.com/videos/dixie-is-posing-with-naked-ass-very-erotic/', 'md5': '1fee339c610d2049699ef2aa699439f1', 'info_dict': { @@ -22,7 +22,18 @@ class HellPornoIE(InfoExtractor): 'thumbnail': 're:https?://.*\.jpg$', 'age_limit': 18, } - } + }, { + 'url' : 'http://hellporno.net/v/186486/', + 'md5': '65adb331709d68d01067527d5547ae88', + 'info_dict': { + 'id': '186486', + 'display_id': '186486', + 'ext': 'mp4', + 'title': 'Tattooed brunette tries anal sex with a big cock', + 'thumbnail': 're:https?://.*\.jpg/$', + 'age_limit': 18, + } + }] def _real_extract(self, url): display_id = self._match_id(url) @@ -38,7 +49,9 @@ class HellPornoIE(InfoExtractor): video_id = flashvars.get('video_id') thumbnail = flashvars.get('preview_url') - ext = flashvars.get('postfix', '.mp4')[1:] + ext = flashvars.get('postfix') + if ext is not None: + ext = ext[ext.rfind(".")+1:] formats = [] for video_url_key in ['video_url', 'video_alt_url']: From f44e293bccf3b99d915400182b6c762667e74928 Mon Sep 17 00:00:00 2001 From: Andy Savicki Date: Mon, 21 Nov 2016 22:15:42 +0300 Subject: [PATCH 2/2] [hellporno] Changes for PR #11247 --- youtube_dl/extractor/hellporno.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/hellporno.py b/youtube_dl/extractor/hellporno.py index abe18696a..e0544884e 100644 --- a/youtube_dl/extractor/hellporno.py +++ b/youtube_dl/extractor/hellporno.py @@ -6,11 +6,12 @@ from .common import InfoExtractor from ..utils import ( js_to_json, remove_end, + determine_ext, ) class HellPornoIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?hellporno\.((com/videos)|(net/v))/(?P[^/]+)' + _VALID_URL = r'https?://(?:www\.)?hellporno\.(?:(?:com/videos)|(?:net/v))/(?P[^/]+)' _TESTS = [{ 'url': 'http://hellporno.com/videos/dixie-is-posing-with-naked-ass-very-erotic/', 'md5': '1fee339c610d2049699ef2aa699439f1', @@ -23,7 +24,7 @@ class HellPornoIE(InfoExtractor): 'age_limit': 18, } }, { - 'url' : 'http://hellporno.net/v/186486/', + 'url': 'http://hellporno.net/v/186486/', 'md5': '65adb331709d68d01067527d5547ae88', 'info_dict': { 'id': '186486', @@ -32,7 +33,10 @@ class HellPornoIE(InfoExtractor): 'title': 'Tattooed brunette tries anal sex with a big cock', 'thumbnail': 're:https?://.*\.jpg/$', 'age_limit': 18, - } + } + }, { + 'url': 'http://hellporno.net/v/186271/', + 'only_matching': True, }] def _real_extract(self, url): @@ -49,9 +53,7 @@ class HellPornoIE(InfoExtractor): video_id = flashvars.get('video_id') thumbnail = flashvars.get('preview_url') - ext = flashvars.get('postfix') - if ext is not None: - ext = ext[ext.rfind(".")+1:] + ext = determine_ext(flashvars.get('postfix'), 'mp4') formats = [] for video_url_key in ['video_url', 'video_alt_url']: