summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/danbooru.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-05-03 23:36:45 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2021-05-03 23:36:45 -0400
commite7eb1f9779f2e223575ab23a6bc1abf2222e7d27 (patch)
tree6cfdc1e3da2143801a598a0ba1182d8f7289dc6d /gallery_dl/extractor/danbooru.py
parentd27dcd4646242d6da8436f14c7b37ce864355858 (diff)
New upstream version 1.17.3.upstream/1.17.3
Diffstat (limited to 'gallery_dl/extractor/danbooru.py')
-rw-r--r--gallery_dl/extractor/danbooru.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gallery_dl/extractor/danbooru.py b/gallery_dl/extractor/danbooru.py
index 33797f9..1f86ea5 100644
--- a/gallery_dl/extractor/danbooru.py
+++ b/gallery_dl/extractor/danbooru.py
@@ -32,6 +32,7 @@ class DanbooruExtractor(Extractor):
super().__init__(match)
self.root = "https://{}.donmai.us".format(match.group(1))
self.ugoira = self.config("ugoira", False)
+ self.extended_metadata = self.config("metadata", False)
username, api_key = self._get_auth_info()
if username:
@@ -64,6 +65,14 @@ class DanbooruExtractor(Extractor):
url = post["large_file_url"]
post["extension"] = "webm"
+ if self.extended_metadata:
+ template = (
+ "{}/posts/{}.json"
+ "?only=artist_commentary,children,notes,parent"
+ )
+ resp = self.request(template.format(self.root, post["id"]))
+ post.update(resp.json())
+
post.update(data)
yield Message.Directory, post
yield Message.Url, url, post