mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[boosty] add 'bought' option (#2387)
This commit is contained in:
parent
ee8c4e2e49
commit
8548fc3a70
@ -28,13 +28,15 @@ class BoostyExtractor(Extractor):
|
|||||||
|
|
||||||
self._user = None if self.config("metadata") else False
|
self._user = None if self.config("metadata") else False
|
||||||
self.only_allowed = self.config("allowed", True)
|
self.only_allowed = self.config("allowed", True)
|
||||||
|
self.only_bought = self.config("bought")
|
||||||
|
|
||||||
videos = self.config("videos")
|
videos = self.config("videos")
|
||||||
if videos is None:
|
if videos is None or videos:
|
||||||
videos = ("quad_hd", "ultra_hd", "full_hd",
|
if isinstance(videos, str):
|
||||||
"high", "medium", "low")
|
videos = videos.split(",")
|
||||||
elif videos and isinstance(videos, str):
|
elif not isinstance(videos, (list, tuple)):
|
||||||
videos = videos.split(",")
|
videos = ("quad_hd", "ultra_hd", "full_hd",
|
||||||
|
"high", "medium", "low")
|
||||||
self.videos = videos
|
self.videos = videos
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
@ -247,6 +249,10 @@ class BoostyAPI():
|
|||||||
"offset" : None,
|
"offset" : None,
|
||||||
"comments_limit": "2",
|
"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")
|
return self._pagination(endpoint, params, key="posts")
|
||||||
|
|
||||||
def user(self, username):
|
def user(self, username):
|
||||||
|
Loading…
Reference in New Issue
Block a user