Skip to content

Commit

Permalink
[boosty] add 'bought' option (#2387)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Oct 3, 2024
1 parent ee8c4e2 commit 8548fc3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions gallery_dl/extractor/boosty.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8548fc3

Please sign in to comment.