[fanbox] add 'fee-max' option (#7726)

This commit is contained in:
Mike Fährmann
2025-06-24 14:47:09 +02:00
parent 308373e3cb
commit e7107f160d
4 changed files with 20 additions and 0 deletions

View File

@@ -61,7 +61,14 @@ class FanboxExtractor(Extractor):
FanboxExtractor._warning = False
def items(self):
fee_max = self.config("fee-max")
for item in self.posts():
if fee_max is not None and fee_max < item["feeRequired"]:
self.log.warning("Skipping post %s (feeRequired of %s > %s)",
item["id"], item["feeRequired"], fee_max)
continue
try:
url = "https://api.fanbox.cc/post.info?postId=" + item["id"]
body = self.request_json(url, headers=self.headers)["body"]