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

[pixiv] extend 'metadata' option (#3057)

make it usable for all 'pixiv' extractors
This commit is contained in:
Mike Fährmann 2022-10-16 15:32:31 +02:00
parent 0714274f1f
commit 52d1eb928d
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 7 additions and 3 deletions

View File

@ -1971,8 +1971,8 @@ Description
It is possible to use ``"all"`` instead of listing all values separately.
extractor.pixiv.artworks.metadata
---------------------------------
extractor.pixiv.metadata
------------------------
Type
``bool``
Default

View File

@ -230,6 +230,7 @@
{
"refresh-token": null,
"include": "artworks",
"metadata": false,
"tags": "japanese",
"ugoira": true
},

View File

@ -45,6 +45,7 @@ class PixivExtractor(Extractor):
work["tags"] = [tag["name"] for tag in work["tags"]]
ratings = {0: "General", 1: "R-18", 2: "R-18G"}
userdata = self.config("metadata")
metadata = self.metadata()
works = self.works()
@ -60,6 +61,8 @@ class PixivExtractor(Extractor):
del work["image_urls"]
del work["meta_pages"]
if userdata:
work.update(self.api.user_detail(work["user"]["id"]))
if transform_tags:
transform_tags(work)
work["num"] = 0
@ -198,7 +201,7 @@ class PixivArtworksExtractor(PixivExtractor):
def metadata(self):
if self.config("metadata"):
return self.api.user_detail(self.user_id)
self.api.user_detail(self.user_id)
return {}
def works(self):