From 90ac2cf996f6066919168ce0b73d1d865f2613c3 Mon Sep 17 00:00:00 2001 From: Tristan Waddington Date: Sun, 8 Mar 2020 01:41:57 -0800 Subject: [PATCH 1/2] Address feedback --- youtube_dl/extractor/pornhub.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index b3885747b..53e923772 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -165,10 +165,9 @@ class PornHubIE(PornHubBaseIE): mobj = re.match(self._VALID_URL, url) host = mobj.group('host') or 'pornhub.com' video_id = mobj.group('id') - cookie_file = self._downloader.params.get('cookiefile') - if host == 'pornhubpremium.com': - if not cookie_file: + if 'premium' in host: + if not self._downloader.params.get('cookiefile'): raise ExtractorError( 'PornHub Premium requires authentication.' ' You may want to use --cookies.', From 029b16e0eeb4e7aac8c98c1846cf34065ca8f638 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Sun, 8 Mar 2020 17:59:11 +0700 Subject: [PATCH 2/2] [pornhub] Add a test --- youtube_dl/extractor/pornhub.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index 53e923772..3567a3283 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -149,6 +149,9 @@ class PornHubIE(PornHubBaseIE): }, { 'url': 'https://www.pornhub.net/view_video.php?viewkey=203640933', 'only_matching': True, + }, { + 'url': 'https://www.pornhubpremium.com/view_video.php?viewkey=ph5e4acdae54a82', + 'only_matching': True, }] @staticmethod