Merge pull request #3413 from ClosedPort22/e621-manual-pagination

[e621] implement manual pagination
This commit is contained in:
Mike Fährmann
2022-12-17 15:42:00 +01:00
committed by GitHub
2 changed files with 23 additions and 1 deletions

View File

@@ -41,6 +41,11 @@ class DanbooruExtractor(BaseExtractor):
self.ugoira = self.config("ugoira", False)
self.external = self.config("external", False)
self.extended_metadata = self.config("metadata", False)
threshold = self.config("threshold")
if isinstance(threshold, int):
self.threshold = 1 if threshold < 1 else threshold
else:
self.threshold = self.per_page
username, api_key = self._get_auth_info()
if username:
@@ -126,7 +131,7 @@ class DanbooruExtractor(BaseExtractor):
posts = posts["posts"]
yield from posts
if len(posts) < self.per_page:
if len(posts) < self.threshold:
return
if pagenum: