summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/pixiv.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-03-13 16:26:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-03-13 16:26:30 -0500
commit3201d77a148367d739862b4f07868a76eaeb7cb1 (patch)
tree78b8d71633ec000672a84ad0bbbddd0513ae2d30 /gallery_dl/extractor/pixiv.py
parentfc83315c164afd74734adf27e0f7fec2011904aa (diff)
New upstream version 1.17.0.upstream/1.17.0
Diffstat (limited to 'gallery_dl/extractor/pixiv.py')
-rw-r--r--gallery_dl/extractor/pixiv.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py
index be976e9..db49b90 100644
--- a/gallery_dl/extractor/pixiv.py
+++ b/gallery_dl/extractor/pixiv.py
@@ -29,11 +29,12 @@ class PixivExtractor(Extractor):
Extractor.__init__(self, match)
self.api = PixivAppAPI(self)
self.load_ugoira = self.config("ugoira", True)
+ self.translated_tags = self.config("translated-tags", False)
def items(self):
+ tkey = "translated_name" if self.translated_tags else "name"
ratings = {0: "General", 1: "R-18", 2: "R-18G"}
metadata = self.metadata()
- yield Message.Version, 1
for work in self.works():
if not work["user"]["id"]:
@@ -45,7 +46,7 @@ class PixivExtractor(Extractor):
del work["image_urls"]
del work["meta_pages"]
work["num"] = 0
- work["tags"] = [tag["name"] for tag in work["tags"]]
+ work["tags"] = [tag[tkey] or tag["name"] for tag in work["tags"]]
work["date"] = text.parse_datetime(work["create_date"])
work["rating"] = ratings.get(work["x_restrict"])
work["suffix"] = ""