diff --git a/docs/configuration.rst b/docs/configuration.rst index d116a01c..7543828f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index e507eb03..1fcbb3b2 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -230,6 +230,7 @@ { "refresh-token": null, "include": "artworks", + "metadata": false, "tags": "japanese", "ugoira": true }, diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index 6b2e1c3f..bda924a0 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -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):