[pixiv] warn about invalid 'PHPSESSID' cookie (#8689)
This commit is contained in:
@@ -237,10 +237,13 @@ class PixivExtractor(Extractor):
|
||||
return data["body"]
|
||||
|
||||
self.log.debug("Server response: %s", util.json_dumps(data))
|
||||
return self.log.error(
|
||||
"'%s'", data.get("message") or "General Error")
|
||||
if (msg := data.get("message")) == "An unknown error occurred":
|
||||
msg = "Invalid 'PHPSESSID' cookie"
|
||||
else:
|
||||
msg = f"'{msg or 'General Error'}'"
|
||||
self.log.error("%s", msg)
|
||||
except Exception:
|
||||
return None
|
||||
pass
|
||||
|
||||
def _extract_ajax(self, work, body):
|
||||
work["_ajax"] = True
|
||||
|
||||
@@ -107,6 +107,7 @@ __tests__ = (
|
||||
"#comment" : "Invalid PHPSESSID cookie",
|
||||
"#class" : pixiv.PixivArtworksExtractor,
|
||||
"#options" : {"cookies": {"PHPSESSID": "12345_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},
|
||||
"#log" : "Invalid 'PHPSESSID' cookie",
|
||||
"#sha1_url": "852c31ad83b6840bacbce824d85f2a997889efb7",
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user