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:
parent
0714274f1f
commit
52d1eb928d
@ -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
|
||||
|
@ -230,6 +230,7 @@
|
||||
{
|
||||
"refresh-token": null,
|
||||
"include": "artworks",
|
||||
"metadata": false,
|
||||
"tags": "japanese",
|
||||
"ugoira": true
|
||||
},
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user