diff --git a/docs/configuration.rst b/docs/configuration.rst index 51408d3c906..3052385f710 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2317,6 +2317,16 @@ Description Extract a user's direct messages as ``dms`` metadata. +extractor.kemonoparty.announcements +----------------------------------- +Type + ``bool`` +Default + ``false`` +Description + Extract a user's announcements as ``announcements`` metadata. + + extractor.kemonoparty.favorites ------------------------------- Type diff --git a/gallery_dl/extractor/kemonoparty.py b/gallery_dl/extractor/kemonoparty.py index f7f5ea9d113..bb0b03af931 100644 --- a/gallery_dl/extractor/kemonoparty.py +++ b/gallery_dl/extractor/kemonoparty.py @@ -57,7 +57,7 @@ def items(self): generators = self._build_file_generators(self.config("files")) duplicates = self.config("duplicates") comments = self.config("comments") - username = dms = None + username = dms = announcements = None # prevent files from being sent with gzip compression headers = {"Accept-Encoding": "identity"} @@ -68,6 +68,8 @@ def items(self): '"): - footer = text.extr(dm, "") - dms.append({ + cards = [] + for card in text.extract_iter(page, ""): + footer = text.extr(card, "") + cards.append({ "body": text.unescape(text.extr( - dm, "
", "
", " 19: diff --git a/test/results/kemonoparty.py b/test/results/kemonoparty.py index 7b8d1301c8a..4c370089792 100644 --- a/test/results/kemonoparty.py +++ b/test/results/kemonoparty.py @@ -135,6 +135,19 @@ }], }, +{ + "#url" : "https://kemono.su/patreon/user/3161935/post/68231671", + "#comment" : "announcements", + "#category": ("", "kemonoparty", "patreon"), + "#class" : kemonoparty.KemonopartyPostExtractor, + "#options" : {"announcements": True}, + + "announcements": [{ + "body": "
Thank you so much for the support!
This Patreon is more of a tip jar for supporting what I make. I have to clarify that there are no exclusive Patreon animations because all are released for the public. You will get earlier access to WIPs. Direct downloads to my works are also available for $5 and $10 Tiers.
", + "date": "2023-02", + }], +}, + { "#url" : "https://kemono.su/patreon/user/19623797/post/29035449", "#comment" : "invalid file (#3510)",