diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index 7aee39bf..d2dd33a4 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -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) diff --git a/test/results/pixiv.py b/test/results/pixiv.py index b0cce7d8..ad6ac4b8 100644 --- a/test/results/pixiv.py +++ b/test/results/pixiv.py @@ -102,6 +102,14 @@ __tests__ = ( }, }, +{ + "#url" : "https://www.pixiv.net/en/users/173530/artworks", + "#comment" : "Invalid PHPSESSID cookie", + "#class" : pixiv.PixivArtworksExtractor, + "#options" : {"cookies": {"PHPSESSID": "12345_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}, + "#sha1_url": "852c31ad83b6840bacbce824d85f2a997889efb7", +}, + { "#url" : "https://www.pixiv.net/en/users/173530/artworks/%E6%89%8B%E3%81%B6%E3%82%8D", "#comment" : "illusts with specific tag",