mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
The previous code would raise an exception when there are no or more than 1 plans with a fee higher than 'feeRequired'.
This commit is contained in:
parent
f58b0e6fc7
commit
ad25be3420
@ -117,8 +117,15 @@ class FanboxExtractor(Extractor):
|
||||
try:
|
||||
post["plan"] = plans[fee]
|
||||
except KeyError:
|
||||
post["plan"] = plans[fee] = min(
|
||||
p for p in plans.values() if p["fee"] >= fee)
|
||||
fees = [f for f in plans if f >= 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user