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