The previous code would raise an exception when there are no or
more than 1 plans with a fee higher than 'feeRequired'.
pull/5783/head
Mike Fährmann 3 months ago
parent f58b0e6fc7
commit ad25be3420
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -117,8 +117,15 @@ class FanboxExtractor(Extractor):
try: try:
post["plan"] = plans[fee] post["plan"] = plans[fee]
except KeyError: except KeyError:
post["plan"] = plans[fee] = min( fees = [f for f in plans if f >= fee]
p for p in plans.values() if p["fee"] >= fee) if fees:
plan = plans[min(fees)]
else:
plan = plans[0].copy()
plan["fee"] = fee
post["plan"] = plans[fee] = plan
print(post["plan"])
exit()
return content_body, post return content_body, post

Loading…
Cancel
Save