Update pixiv.py

This commit is contained in:
johnsmith1202gmail
2023-08-30 12:42:31 -07:00
committed by GitHub
parent d3046561d4
commit c7e31b2724

View File

@@ -863,9 +863,14 @@ class PixivNovelExtractor(PixivExtractor):
novel["suffix"] = ""
yield Message.Directory, novel
try:
content = self.api.novel_text(novel["id"])["novel_text"]
except Exception:
self.log.warning("Unable to download novel %s", novel["id"])
continue
novel["extension"] = "txt"
content = self.api.novel_text(novel["id"])["novel_text"]
yield Message.Url, "text:" + content, novel
if embeds:
@@ -1210,10 +1215,6 @@ class PixivAppAPI():
self.extractor.wait(seconds=300)
continue
if response.status_code == 403 \
and "Artist has made their work private" in (error.get("message") or "").lower():
raise exception.NotFoundError()
raise exception.StopExtraction("API request failed: %s", error)
def _pagination(self, endpoint, params, key="illusts"):