From 41e4a7c93b52d940ae2efc78d47cdf0eef0c2e4b Mon Sep 17 00:00:00 2001 From: Eitan Postavsky Date: Fri, 9 Mar 2018 10:10:58 -0500 Subject: [PATCH 1/2] fix Pornhub cookie issue --- youtube_dl/extractor/pornhub.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index 281a4f05e..5afa35dd2 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -116,11 +116,11 @@ class PornHubIE(InfoExtractor): video_id = self._match_id(url) def dl_webpage(platform): + self._set_cookie('pornhub.com', 'age_verified', '1') + self._set_cookie('pornhub.com', 'platform', platform) return self._download_webpage( 'http://www.pornhub.com/view_video.php?viewkey=%s' % video_id, - video_id, headers={ - 'Cookie': 'age_verified=1; platform=%s' % platform, - }) + video_id) webpage = dl_webpage('pc') From e13ad4c368896ba07df926120690924bdfd8c3c2 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Fri, 9 Mar 2018 23:54:47 +0700 Subject: [PATCH 2/2] Update pornhub.py --- youtube_dl/extractor/pornhub.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index 5afa35dd2..a7099bbbf 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -114,9 +114,10 @@ class PornHubIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) + + self._set_cookie('pornhub.com', 'age_verified', '1') def dl_webpage(platform): - self._set_cookie('pornhub.com', 'age_verified', '1') self._set_cookie('pornhub.com', 'platform', platform) return self._download_webpage( 'http://www.pornhub.com/view_video.php?viewkey=%s' % video_id,