Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continue downloading when the item is made private on pixiv #4481

Merged
merged 2 commits into from
Sep 2, 2023

Conversation

johnsmith1202gmail
Copy link
Contributor

No description provided.

@johnsmith1202gmail
Copy link
Contributor Author

#4480

@mikf
Copy link
Owner

mikf commented Aug 30, 2023

This wouldn't fix the problem of it stopping for private novels,
it would only wrap the error in a different message.

I'd rather use something like this:

diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py
index ffe8030f..fc5f39c4 100644
--- a/gallery_dl/extractor/pixiv.py
+++ b/gallery_dl/extractor/pixiv.py
@@ -864,8 +864,13 @@ class PixivNovelExtractor(PixivExtractor):
 
             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:

@mikf
Copy link
Owner

mikf commented Aug 30, 2023

I'm also getting a quite different error message with my own account:

[urllib3.connectionpool][debug] https://app-api.pixiv.net:443 "GET /v1/novel/text?novel_id=14627271 HTTP/1.1" 403 None
[pixiv][debug] {'error': {'user_message': 'There was an error with the privacy settings.', 'message': '', 'reason': '', 'user_message_details': {}}}

@johnsmith1202gmail
Copy link
Contributor Author

great suggestion, I made the change accordingly

@mikf mikf merged commit 03d471a into mikf:master Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants