From b92a827c2b9674a6b02c884907a1db73076ff6bd Mon Sep 17 00:00:00 2001 From: AiraNadih <128119996+AiraNadih@users.noreply.github.com> Date: Thu, 14 Aug 2025 09:36:53 +0800 Subject: [PATCH] fix(routes): update API path to fetch post data for coomer / kemono (close #19832) (#19833) Co-authored-by: AiraNadih --- lib/routes/coomer/index.ts | 4 ++-- lib/routes/kemono/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/coomer/index.ts b/lib/routes/coomer/index.ts index 778b6135b..7b7c242e9 100644 --- a/lib/routes/coomer/index.ts +++ b/lib/routes/coomer/index.ts @@ -53,7 +53,7 @@ async function handler(ctx) { const rootUrl = 'https://coomer.st'; const apiUrl = `${rootUrl}/api/v1`; - const currentUrl = isPosts ? `${apiUrl}/posts` : `${apiUrl}/${source}/user/${id}`; + const currentUrl = isPosts ? `${apiUrl}/posts` : `${apiUrl}/${source}/user/${id}/posts`; const headers = { cookie: '__ddg2=sBQ4uaaGecmfEUk7', @@ -66,7 +66,7 @@ async function handler(ctx) { }); const responseData = isPosts ? response.data.posts : response.data; - const author = isPosts ? '' : await getAuthor(currentUrl, headers); + const author = isPosts ? '' : await getAuthor(`${apiUrl}/${source}/user/${id}`, headers); const title = isPosts ? 'Coomer Posts' : `Posts of ${author} from ${source} | Coomer`; const image = isPosts ? `${rootUrl}/favicon.ico` : `https://img.coomer.st/icons/${source}/${id}`; const items = responseData diff --git a/lib/routes/kemono/index.ts b/lib/routes/kemono/index.ts index e67c5dad2..8d1b67ba0 100644 --- a/lib/routes/kemono/index.ts +++ b/lib/routes/kemono/index.ts @@ -94,7 +94,7 @@ function buildApiUrl(source: string, userId?: string, contentType?: string): str } const basePath = `${KEMONO_API_URL}/${source}/user/${userId}`; - return contentType ? `${basePath}/${contentType}` : basePath; + return contentType ? `${basePath}/${contentType}` : `${basePath}/posts`; } function buildFrontendUrl(source: string, userId?: string, contentType?: string): string {