diff options
Diffstat (limited to 'gallery_dl/extractor/webtoons.py')
| -rw-r--r-- | gallery_dl/extractor/webtoons.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gallery_dl/extractor/webtoons.py b/gallery_dl/extractor/webtoons.py index 55324cb..a3dc6a0 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): |
