diff --git a/docs/configuration.rst b/docs/configuration.rst index 48a0ea30..ed64ff02 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1212,6 +1212,16 @@ Description Download video files. +extractor.kemonoparty.max-posts +------------------------------- +Type + ``integer`` +Default + ``null`` +Description + Limit the number of posts to download. + + extractor.kemonoparty.metadata ------------------------------ Type diff --git a/gallery_dl/extractor/kemonoparty.py b/gallery_dl/extractor/kemonoparty.py index 62f42c20..f4496910 100644 --- a/gallery_dl/extractor/kemonoparty.py +++ b/gallery_dl/extractor/kemonoparty.py @@ -10,6 +10,7 @@ from .common import Extractor, Message from .. import text +import itertools import re BASE_PATTERN = r"(?:https?://)?kemono\.party/([^/?#]+)/user/([^/?#]+)" @@ -40,7 +41,12 @@ class KemonopartyExtractor(Extractor): else: username = None - for post in self.posts(): + posts = self.posts() + max_posts = self.config("max-posts") + if max_posts: + posts = itertools.islice(posts, max_posts) + + for post in posts: files = [] append = files.append