From ef9891ec9d700c198053ffb2c0d475d459055a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 16 Jun 2023 15:43:07 +0200 Subject: [PATCH] [fantia] extract 'plan' metadata (#2477, #4128) --- gallery_dl/extractor/fantia.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gallery_dl/extractor/fantia.py b/gallery_dl/extractor/fantia.py index c4a9b4b8..35c4cc45 100644 --- a/gallery_dl/extractor/fantia.py +++ b/gallery_dl/extractor/fantia.py @@ -24,6 +24,14 @@ class FantiaExtractor(Extractor): "Accept" : "application/json, text/plain, */*", "Referer": self.root, } + _empty_plan = { + "id" : 0, + "price": 0, + "limit": 0, + "name" : "", + "description": "", + "thumb": self.root + "/images/fallback/plan/thumb_default.png", + } if self._warning: if not self._check_cookies(("_session_id",)): @@ -39,6 +47,7 @@ class FantiaExtractor(Extractor): post["content_title"] = content["title"] post["content_filename"] = content.get("filename", "") post["content_id"] = content["id"] + post["plan"] = content["plan"] or _empty_plan yield Message.Directory, post if content["visible_status"] != "visible": @@ -116,6 +125,7 @@ class FantiaExtractor(Extractor): "category": "thumb", "download_uri": url, "visible_status": "visible", + "plan": None, }) return contents