1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[pixiv] add 'metadata' option (#1551)

This commit is contained in:
Mike Fährmann 2021-05-14 20:30:28 +02:00
parent 0717456b4e
commit 5eeaaee01d
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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)