From 8a909e478de9fbe1d573f7f3db7fdeb4c01140d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 22 May 2021 21:36:56 +0200 Subject: [PATCH] [imagebam] fix extraction of NSFW images (#1534) --- gallery_dl/extractor/imagebam.py | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/gallery_dl/extractor/imagebam.py b/gallery_dl/extractor/imagebam.py index 545a75d0..93708407 100644 --- a/gallery_dl/extractor/imagebam.py +++ b/gallery_dl/extractor/imagebam.py @@ -16,13 +16,28 @@ class ImagebamExtractor(Extractor): """Base class for imagebam extractors""" category = "imagebam" root = "https://www.imagebam.com" + cookies = None + + def __init__(self, match): + Extractor.__init__(self, match) + self.key = match.group(1) + if self.cookies: + self.session.cookies = self.cookies def get_image_data(self, data): page_url = "{}/image/{}".format(self.root, data["image_key"]) page = self.request(page_url).text image_url, pos = text.extract(page, '