diff options
| author | 2024-06-22 21:19:36 -0400 | |
|---|---|---|
| committer | 2024-06-22 21:19:36 -0400 | |
| commit | 80e39a8fc7de105510cbbdca8507f2a4b8c9e01d (patch) | |
| tree | bb5caa2f5fafc5116b8f89e659085ffbd8a918f2 /gallery_dl/extractor/fanbox.py | |
| parent | 1c28712d865e30ed752988ba0b6944882250b665 (diff) | |
New upstream version 1.27.1.upstream/1.27.1
Diffstat (limited to 'gallery_dl/extractor/fanbox.py')
| -rw-r--r-- | gallery_dl/extractor/fanbox.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gallery_dl/extractor/fanbox.py b/gallery_dl/extractor/fanbox.py index 2223403..d81fd0b 100644 --- a/gallery_dl/extractor/fanbox.py +++ b/gallery_dl/extractor/fanbox.py @@ -113,7 +113,17 @@ class FanboxExtractor(Extractor): post["user"] = self._get_user_data(post["creatorId"]) if self._meta_plan: plans = self._get_plan_data(post["creatorId"]) - post["plan"] = plans[post["feeRequired"]] + fee = post["feeRequired"] + try: + post["plan"] = plans[fee] + except KeyError: + 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 return content_body, post |
