Skip to content

Commit

Permalink
[zerochan] fix tag redirections (#5891)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jul 26, 2024
1 parent b5e141e commit 70f18b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gallery_dl/extractor/zerochan.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ def posts_api(self):
static = "https://static.zerochan.net/.full."

while True:
data = self.request(url, params=params).json()
response = self.request(url, params=params, allow_redirects=False)
if response.status_code >= 300:
url = text.urljoin(self.root, response.headers["location"])
response = self.request(url, params=params)
data = response.json()

try:
posts = data["items"]
except Exception:
Expand Down

0 comments on commit 70f18b7

Please sign in to comment.