[zerochan] fix tag redirections (#5891)

pull/3101/merge
Mike Fährmann 2 months ago
parent b5e141ed6e
commit 70f18b7a78
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -189,7 +189,12 @@ class ZerochanTagExtractor(ZerochanExtractor):
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:

Loading…
Cancel
Save