[pixiv] fix artworks downloads when using expired cookies (#7987)

This commit is contained in:
Mike Fährmann
2025-08-07 18:55:52 +02:00
parent ba174b1a06
commit f2a58118eb
2 changed files with 10 additions and 4 deletions

View File

@@ -446,16 +446,14 @@ class PixivArtworksExtractor(PixivExtractor):
if self.sanity_workaround:
body = self._request_ajax(
f"/user/{self.user_id}/profile/all")
if not body:
return ()
try:
ajax_ids = list(map(int, body["illusts"]))
ajax_ids.extend(map(int, body["manga"]))
ajax_ids.sort()
except Exception as exc:
self.log.debug("", exc_info=exc)
self.log.warning("u%s: Failed to collect artwork IDs "
"using AJAX API (%s: %s)",
self.user_id, exc.__class__.__name__, exc)
"using AJAX API", self.user_id)
else:
works = self._extend_sanity(works, ajax_ids)