summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/booru.py
diff options
context:
space:
mode:
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"""