[fanbox:creator] add 'offset' option (#6582)

https://github.com/mikf/gallery-dl/issues/6582#issuecomment-3456132723
This commit is contained in:
Mike Fährmann
2025-10-28 14:25:17 +01:00
parent 92be3fb911
commit 3573dcbff9
3 changed files with 27 additions and 2 deletions

View File

@@ -362,9 +362,20 @@ class FanboxCreatorExtractor(FanboxExtractor):
def _pagination_creator(self, url):
urls = self.request_json(url, headers=self.headers)["body"]
if offset := self.config("offset"):
quotient, remainder = divmod(offset, 10)
if quotient:
urls = urls[quotient:]
else:
remainder = None
for url in urls:
url = text.ensure_http_scheme(url)
yield from self.request_json(url, headers=self.headers)["body"]
posts = self.request_json(url, headers=self.headers)["body"]
if remainder:
posts = posts[remainder:]
remainder = None
yield from posts
class FanboxPostExtractor(FanboxExtractor):