summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/booru.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/booru.py
parentd27dcd4646242d6da8436f14c7b37ce864355858 (diff)
New upstream version 1.17.3.upstream/1.17.3
Diffstat (limited to 'gallery_dl/extractor/booru.py')
-rw-r--r--gallery_dl/extractor/booru.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/gallery_dl/extractor/booru.py b/gallery_dl/extractor/booru.py
index c3cf3f7..a42ec53 100644
--- a/gallery_dl/extractor/booru.py
+++ b/gallery_dl/extractor/booru.py
@@ -24,6 +24,7 @@ class BooruExtractor(BaseExtractor):
self.login()
data = self.metadata()
tags = self.config("tags", False)
+ notes = self.config("notes", False)
for post in self.posts():
try:
@@ -35,8 +36,11 @@ class BooruExtractor(BaseExtractor):
"(md5: %s)", post.get("id"), post.get("md5"))
continue
+ page_html = None
if tags:
- self._extended_tags(post)
+ page_html = self._extended_tags(post)
+ if notes:
+ self._notes(post, page_html)
self._prepare(post)
post.update(data)
text.nameext_from_url(url, post)
@@ -66,4 +70,13 @@ class BooruExtractor(BaseExtractor):
"""Prepare the 'post's metadata"""
def _extended_tags(self, post, page=None):
- """Generate extended tag information"""
+ """Generate extended tag information
+
+ The return value of this function will be
+ passed to the _notes function as the page parameter.
+ This makes it possible to reuse the same HTML both for
+ extracting tags and notes.
+ """
+
+ def _notes(self, post, page=None):
+ """Generate information about notes"""