diff --git a/docs/configuration.rst b/docs/configuration.rst index a59bf3ad..d3ffb031 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2029,6 +2029,26 @@ Description Also emit metadata for text-only posts without media content. +extractor.[misskey].renotes +---------------------------- +Type + ``bool`` +Default + ``false`` +Description + Fetch media from renoted notes. + + +extractor.[misskey].replies +---------------------------- +Type + ``bool`` +Default + ``true`` +Description + Fetch media from replies to other notes. + + extractor.nana.favkey --------------------- Type diff --git a/gallery_dl/extractor/misskey.py b/gallery_dl/extractor/misskey.py index 3d5f3218..06fccc7d 100644 --- a/gallery_dl/extractor/misskey.py +++ b/gallery_dl/extractor/misskey.py @@ -20,10 +20,26 @@ class MisskeyExtractor(BaseExtractor): self.api = MisskeyAPI(self) self.instance = self.root.rpartition("://")[2] self.item = match.group(match.lastindex) + self.renotes = self.config("renotes", False) + self.replies = self.config("replies", True) def items(self): for note in self.notes(): - files = note.pop("files") or () + files = note.pop("files") or [] + renote = note.get("renote") + if renote: + if not self.renotes: + self.log.debug("Skipping %s (renote)", note["id"]) + continue + files.extend(renote.get("files") or ()) + + reply = note.get("reply") + if reply: + if not self.replies: + self.log.debug("Skipping %s (reply)", note["id"]) + continue + files.extend(reply.get("files") or ()) + note["instance"] = self.instance note["instance_remote"] = note["user"]["host"] note["count"] = len(files)