From bf88f05d585b03ca30857bb4a68820f99b5a0368 Mon Sep 17 00:00:00 2001 From: olabala Date: Thu, 27 Mar 2025 18:40:14 +0800 Subject: [PATCH] fix(source): zhihu (#92) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: k.target.id may exceed the safe integer range (2^53−1), use urlId --- server/sources/zhihu.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/sources/zhihu.ts b/server/sources/zhihu.ts index 4488750..fe082ac 100644 --- a/server/sources/zhihu.ts +++ b/server/sources/zhihu.ts @@ -25,13 +25,14 @@ export default defineSource({ const res: Res = await myFetch(url) return res.data .map((k) => { + const urlId = k.target.url?.match(/(\d+)$/)?.[1] return { id: k.target.id, title: k.target.title, extra: { icon: k.card_label?.night_icon && proxyPicture(k.card_label.night_icon), }, - url: `https://www.zhihu.com/question/${k.target.id}`, + url: `https://www.zhihu.com/question/${urlId || k.target.id}`, } }) },