From 5eeaaee01d5127ff5b2d28d867061d568f6774da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 14 May 2021 20:30:28 +0200 Subject: [PATCH] [pixiv] add 'metadata' option (#1551) --- docs/configuration.rst | 10 ++++++++++ gallery_dl/extractor/pixiv.py | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index e6aa99c4..eb194a34 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1346,6 +1346,16 @@ Description Download user avatars. +extractor.pixiv.user.metadata +----------------------------- +Type + ``bool`` +Default + ``false`` +Description + Fetch extended ``user`` metadata. + + extractor.pixiv.work.related ---------------------------- Type diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index 58e805db..bdd132c4 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -124,7 +124,8 @@ class PixivUserExtractor(PixivExtractor): }), # deleted account ("http://www.pixiv.net/member_illust.php?id=173531", { - "count": 0, + "options": (("metadata", True),), + "exception": exception.NotFoundError, }), ("https://www.pixiv.net/en/users/173530"), ("https://www.pixiv.net/en/users/173530/manga"), @@ -147,6 +148,11 @@ class PixivUserExtractor(PixivExtractor): self.user_id = u1 or u2 or u3 self.tag = t1 or t2 + def metadata(self): + if self.config("metadata"): + return {"user": self.api.user_detail(self.user_id)} + return {} + def works(self): works = self.api.user_illusts(self.user_id)