From ba174b1a06754db4a8a44dd30c8a1c10afc121a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 7 Aug 2025 18:34:50 +0200 Subject: [PATCH] [pixiv] remove redundant cookies initialization 7916c8bf77fb86cbb91deffbb9f38187b971cc77 75674944f0f030faf0cb61ee2d49a957570edbce --- gallery_dl/extractor/pixiv.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index b7776645..7aee39bf 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -429,14 +429,11 @@ class PixivArtworksExtractor(PixivExtractor): self.user_id = u1 or u2 self.tag = t1 or t2 - if self.sanity_workaround: - self.cookies_domain = domain = ".pixiv.net" - self._init_cookies() - if self._warn_phpsessid: - PixivArtworksExtractor._warn_phpsessid = False - if not self.cookies.get("PHPSESSID", domain=domain): - self.log.warning("No 'PHPSESSID' cookie set. Can detect on" - "ly non R-18 'limit_sanity_level' works.") + if self.sanity_workaround and self._warn_phpsessid: + PixivArtworksExtractor._warn_phpsessid = False + if not self.cookies.get("PHPSESSID", domain=self.cookies_domain): + self.log.warning("No 'PHPSESSID' cookie set. Can detect only " + "non R-18 'limit_sanity_level' works.") def metadata(self): if self.config("metadata"):