[kemonoparty] fix 'archives' option (#7416)

use '/vi/file/HASH' API endpoint
since '/v1/posts/archives/HASH' is gone or was renamed
This commit is contained in:
Mike Fährmann
2025-04-25 11:05:02 +02:00
parent 754b704ca1
commit 2e8b447262
2 changed files with 5 additions and 5 deletions

View File

@@ -153,7 +153,7 @@ class KemonopartyExtractor(Extractor):
file["type"] = "archive"
if archives:
try:
data = self.api.posts_archives(file["hash"])
data = self.api.file(file["hash"])
data.update(file)
post_archives.append(data)
except Exception as exc:
@@ -521,9 +521,9 @@ class KemonoAPI():
params = {"q": query, "o": offset, "tag": tags}
return self._pagination(endpoint, params, 50, "posts")
def posts_archives(self, file_hash):
endpoint = "/posts/archives/" + file_hash
return self._call(endpoint)["archive"]
def file(self, file_hash):
endpoint = "/file/" + file_hash
return self._call(endpoint)
def creator_posts(self, service, creator_id, offset=0, query=None):
endpoint = "/{}/user/{}".format(service, creator_id)

View File

@@ -401,7 +401,7 @@ __tests__ = (
"public_id": "soso",
"relation_id": None,
"service": "fanbox",
"updated": "2025-03-03T03:29:08.598883",
"updated": "2025-03-29T05:44:56.747243",
},
"tags": [
"うごイラ",