summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/8chan.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-12-02 00:31:59 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2024-12-02 00:31:59 -0500
commit1981ccaaea6eab2cf32536ec5afe132a870914d8 (patch)
tree013f1e17d922d3a6abf7f57aa6a175c2ce5d93bc /gallery_dl/extractor/8chan.py
parentfc004701f923bb954a22c7fec2ae8d607e78cb2b (diff)
New upstream version 1.28.0.upstream/1.28.0
Diffstat (limited to 'gallery_dl/extractor/8chan.py')
-rw-r--r--gallery_dl/extractor/8chan.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gallery_dl/extractor/8chan.py b/gallery_dl/extractor/8chan.py
index ce1c52a..3e30ddc 100644
--- a/gallery_dl/extractor/8chan.py
+++ b/gallery_dl/extractor/8chan.py
@@ -26,10 +26,6 @@ class _8chanExtractor(Extractor):
self.root = "https://8chan." + match.group(1)
Extractor.__init__(self, match)
- def _init(self):
- tos = self.cookies_tos_name()
- self.cookies.set(tos, "1", domain=self.root[8:])
-
@memcache()
def cookies_tos_name(self):
url = self.root + "/.static/pages/confirmed.html"
@@ -79,6 +75,7 @@ class _8chanThreadExtractor(_8chanExtractor):
def items(self):
_, board, thread = self.groups
+ self.cookies.set(self.cookies_tos_name(), "1", domain=self.root[8:])
# fetch thread data
url = "{}/{}/res/{}.".format(self.root, board, thread)
@@ -116,6 +113,8 @@ class _8chanBoardExtractor(_8chanExtractor):
def items(self):
_, board, pnum = self.groups
+ self.cookies.set(self.cookies_tos_name(), "1", domain=self.root[8:])
+
pnum = text.parse_int(pnum, 1)
url = "{}/{}/{}.json".format(self.root, board, pnum)
data = self.request(url).json()