fix(routes): update API path to fetch post data for coomer / kemono (close #19832) (#19833)

Co-authored-by: AiraNadih <AiraNadih@users.noreply.github.com>
This commit is contained in:
AiraNadih
2025-08-14 09:36:53 +08:00
committed by GitHub
co-authored by AiraNadih
parent 2a0ecf7236
commit b92a827c2b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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 {