mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
[kemonoparty] restore discord pagination (#4676)
This commit is contained in:
parent
c9a976d8a6
commit
174191cb79
@ -344,8 +344,15 @@ class KemonopartyDiscordExtractor(KemonopartyExtractor):
|
||||
def posts(self):
|
||||
url = "{}/api/v1/discord/channel/{}".format(
|
||||
self.root, self.channel_id)
|
||||
params = {"skip": 0}
|
||||
return self.request(url, params=params).json()
|
||||
params = {"o": 0}
|
||||
|
||||
while True:
|
||||
posts = self.request(url, params=params).json()
|
||||
yield from posts
|
||||
|
||||
if len(posts) < 150:
|
||||
break
|
||||
params["o"] += 150
|
||||
|
||||
|
||||
class KemonopartyDiscordServerExtractor(KemonopartyExtractor):
|
||||
|
@ -185,6 +185,18 @@ __tests__ = (
|
||||
"date" : "type:datetime",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://kemono.party/discord/server/818188637329031199#818343747275456522",
|
||||
"#comment" : "pagination",
|
||||
"#category": ("", "kemonoparty", "discord"),
|
||||
"#class" : kemonoparty.KemonopartyDiscordExtractor,
|
||||
"#range" : "1-250",
|
||||
"#count" : 250,
|
||||
|
||||
"channel" : "818343747275456522",
|
||||
"channel_name": "wraith-sfw-gallery",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://kemono.su/discord/server/256559665620451329/channel/462437519519383555#",
|
||||
"#category": ("", "kemonoparty", "discord"),
|
||||
|
Loading…
Reference in New Issue
Block a user