From 8548fc3a704b963537c03a8c6563878cad73f2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 3 Oct 2024 20:23:46 +0200 Subject: [PATCH] [boosty] add 'bought' option (#2387) --- gallery_dl/extractor/boosty.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gallery_dl/extractor/boosty.py b/gallery_dl/extractor/boosty.py index a1eea5fe15..b600e0e0b4 100644 --- a/gallery_dl/extractor/boosty.py +++ b/gallery_dl/extractor/boosty.py @@ -28,13 +28,15 @@ def _init(self): self._user = None if self.config("metadata") else False self.only_allowed = self.config("allowed", True) + self.only_bought = self.config("bought") videos = self.config("videos") - if videos is None: - videos = ("quad_hd", "ultra_hd", "full_hd", - "high", "medium", "low") - elif videos and isinstance(videos, str): - videos = videos.split(",") + if videos is None or videos: + if isinstance(videos, str): + videos = videos.split(",") + elif not isinstance(videos, (list, tuple)): + videos = ("quad_hd", "ultra_hd", "full_hd", + "high", "medium", "low") self.videos = videos def items(self): @@ -247,6 +249,10 @@ def feed_posts(self, params=None): "offset" : None, "comments_limit": "2", }) + if "only_allowed" not in params and self.extractor.only_allowed: + params["only_allowed"] = "true" + if "only_bought" not in params and self.extractor.only_bought: + params["only_bought"] = "true" return self._pagination(endpoint, params, key="posts") def user(self, username):