From 51ceb33b6cf07de7be5b28c3ee8f0422ddf11455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 10 Oct 2024 18:19:37 +0200 Subject: [PATCH] [8chan] also set TOS cookie for the previous day --- gallery_dl/extractor/8chan.py | 6 ++++-- test/results/8chan.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/8chan.py b/gallery_dl/extractor/8chan.py index afa3a698..f81d2a1f 100644 --- a/gallery_dl/extractor/8chan.py +++ b/gallery_dl/extractor/8chan.py @@ -29,8 +29,10 @@ class _8chanExtractor(Extractor): def _init(self): now = util.datetime_utcnow() domain = self.root.rpartition("/")[2] - self.cookies.set("TOS20240928", "1", domain=domain) - self.cookies.set(now.strftime("TOS%Y%m%d"), "1", domain=domain) + self.cookies.set( + now.strftime("TOS%Y%m%d"), "1", domain=domain) + self.cookies.set( + (now - timedelta(1)).strftime("TOS%Y%m%d"), "1", domain=domain) @memcache() def cookies_prepare(self): diff --git a/test/results/8chan.py b/test/results/8chan.py index df281680..e9dc0cf4 100644 --- a/test/results/8chan.py +++ b/test/results/8chan.py @@ -30,7 +30,7 @@ __tests__ = ( "markdown" : str, "maxFileCount" : 5, "maxFileSize" : "32.00 MB", - "maxMessageLength": 8001, + "maxMessageLength": 12000, "message" : str, "mime" : str, "name" : "Anonymous", @@ -73,7 +73,7 @@ __tests__ = ( "#category": ("", "8chan", "board"), "#class" : _8chan._8chanBoardExtractor, "#pattern" : _8chan._8chanThreadExtractor.pattern, - "#count" : range(24, 28), + "#count" : range(24, 32), }, {