[civitai:user-posts] fix pagination (#8955)
fix '400 Bad Request' errors when retrieving more than the first batch of posts.
This commit is contained in:
@@ -691,7 +691,7 @@ class CivitaiTrpcAPI():
|
|||||||
self.root = extractor.root + "/api/trpc/"
|
self.root = extractor.root + "/api/trpc/"
|
||||||
self.headers = {
|
self.headers = {
|
||||||
"content-type" : "application/json",
|
"content-type" : "application/json",
|
||||||
"x-client-version": "5.0.954",
|
"x-client-version": "5.0.1386",
|
||||||
"x-client-date" : "",
|
"x-client-date" : "",
|
||||||
"x-client" : "web",
|
"x-client" : "web",
|
||||||
"x-fingerprint" : "undefined",
|
"x-fingerprint" : "undefined",
|
||||||
@@ -796,7 +796,6 @@ class CivitaiTrpcAPI():
|
|||||||
|
|
||||||
def posts(self, params, defaults=True):
|
def posts(self, params, defaults=True):
|
||||||
endpoint = "post.getInfinite"
|
endpoint = "post.getInfinite"
|
||||||
meta = {"cursor": ("Date",)}
|
|
||||||
|
|
||||||
if defaults:
|
if defaults:
|
||||||
params = self._merge_params(params, {
|
params = self._merge_params(params, {
|
||||||
@@ -811,8 +810,7 @@ class CivitaiTrpcAPI():
|
|||||||
})
|
})
|
||||||
|
|
||||||
params = self._type_params(params)
|
params = self._type_params(params)
|
||||||
return self._pagination(endpoint, params, meta,
|
return self._pagination(endpoint, params, user=("username" in params))
|
||||||
user=("username" in params))
|
|
||||||
|
|
||||||
def collection(self, collection_id):
|
def collection(self, collection_id):
|
||||||
endpoint = "collection.getById"
|
endpoint = "collection.getById"
|
||||||
|
|||||||
Reference in New Issue
Block a user