From 47114339a2375b01ac976fa46d7374e15f7f56ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 7 Dec 2020 14:56:32 +0100 Subject: [PATCH] [webtoons] update 'ageGate' cookie --- gallery_dl/extractor/webtoons.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/webtoons.py b/gallery_dl/extractor/webtoons.py index 55324cbc..a3dc6a03 100644 --- a/gallery_dl/extractor/webtoons.py +++ b/gallery_dl/extractor/webtoons.py @@ -11,7 +11,6 @@ from .common import Extractor, Message from .. import exception, text, util - BASE_PATTERN = r"(?:https?://)?(?:www\.)?webtoons\.com/((en|fr)" @@ -22,10 +21,18 @@ class WebtoonsExtractor(Extractor): def __init__(self, match): Extractor.__init__(self, match) - self.session.cookies.set("ageGatePass", "true", - domain=self.cookiedomain) self.path, self.lang, self.genre , self.comic, self.query = \ match.groups() + cookies = self.session.cookies + cookies.set("pagGDPR", "true", domain=self.cookiedomain) + cookies.set("ageGatePass", "true", domain=self.cookiedomain) + + def request(self, url, **kwargs): + response = Extractor.request(self, url, **kwargs) + if response.history and "/ageGate" in response.request.url: + raise exception.StopExtraction( + "Redirected to age gate check ('%s')", response.request.url) + return response class WebtoonsEpisodeExtractor(WebtoonsExtractor):