aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--yt_dlp/extractor/pornhub.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/yt_dlp/extractor/pornhub.py b/yt_dlp/extractor/pornhub.py
index 5d8d7c100..2f5a572a5 100644
--- a/yt_dlp/extractor/pornhub.py
+++ b/yt_dlp/extractor/pornhub.py
@@ -58,6 +58,11 @@ class PornHubBaseIE(InfoExtractor):
def _real_initialize(self):
self._logged_in = False
+ def _set_age_cookies(self, host):
+ self._set_cookie(host, 'age_verified', '1')
+ self._set_cookie(host, 'accessAgeDisclaimerPH', '1')
+ self._set_cookie(host, 'accessPH', '1')
+
def _login(self, host):
if self._logged_in:
return
@@ -267,8 +272,7 @@ class PornHubIE(PornHubBaseIE):
video_id = mobj.group('id')
self._login(host)
-
- self._set_cookie(host, 'age_verified', '1')
+ self._set_age_cookies(host)
def dl_webpage(platform):
self._set_cookie(host, 'platform', platform)
@@ -569,6 +573,7 @@ class PornHubUserIE(PornHubPlaylistBaseIE):
mobj = self._match_valid_url(url)
user_id = mobj.group('id')
videos_url = '%s/videos' % mobj.group('url')
+ self._set_age_cookies(mobj.group('host'))
page = self._extract_page(url)
if page:
videos_url = update_url_query(videos_url, {'page': page})
@@ -633,6 +638,7 @@ class PornHubPagedPlaylistBaseIE(PornHubPlaylistBaseIE):
item_id = mobj.group('id')
self._login(host)
+ self._set_age_cookies(host)
return self.playlist_result(self._entries(url, host, item_id), item_id)
@@ -812,5 +818,6 @@ class PornHubPlaylistIE(PornHubPlaylistBaseIE):
item_id = mobj.group('id')
self._login(host)
+ self._set_age_cookies(host)
return self.playlist_result(self._entries(mobj.group('url'), host, item_id), item_id)