From 1a9db6a536f40916a06ef94671e29cae6d3ab528 Mon Sep 17 00:00:00 2001 From: Jurangren Date: Fri, 22 Aug 2025 00:52:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20VikaACG=20=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=8A=93=E5=8F=96=EF=BC=8C=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复 VikaACG 平台中提取游戏名称的正则表达式,提高匹配准确性。 * 移除 Koyso 平台中不再需要的调试日志输出,优化代码。 * 在 TWOdfan 平台中新增调试日志,以便检查 API 响应的 HTML 内容。 --- src/platforms/gal/Koyso.ts | 3 --- src/platforms/gal/VikaACG.ts | 2 +- src/platforms/patch/TWOdfan.ts | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/platforms/gal/Koyso.ts b/src/platforms/gal/Koyso.ts index 1ece96e..a5964ea 100644 --- a/src/platforms/gal/Koyso.ts +++ b/src/platforms/gal/Koyso.ts @@ -22,9 +22,6 @@ async function searchKoyso(game: string): Promise { } const html = await response.text(); - // --- DEBUGGING: Print the full HTML content --- - console.log("Koyso API HTML Response:", html); - // --- END DEBUGGING --- const matches = html.matchAll(REGEX); diff --git a/src/platforms/gal/VikaACG.ts b/src/platforms/gal/VikaACG.ts index f9e3ce4..22efcb5 100644 --- a/src/platforms/gal/VikaACG.ts +++ b/src/platforms/gal/VikaACG.ts @@ -6,7 +6,7 @@ const API_URL = "https://www.vikacg.com/wp-json/b2/v1/getPostList"; // The Python code suggests the response text itself might be a JSON string // that contains escaped HTML. Let's try to parse it as JSON first. // The regex is applied to the *unescaped* string. -const REGEX = /

(?.*?)<"/gs; async function searchVikaACG(game: string): Promise { const searchResult: PlatformSearchResult = { diff --git a/src/platforms/patch/TWOdfan.ts b/src/platforms/patch/TWOdfan.ts index df3628a..5ba5a12 100644 --- a/src/platforms/patch/TWOdfan.ts +++ b/src/platforms/patch/TWOdfan.ts @@ -27,6 +27,8 @@ async function searchTWOdfan(game: string): Promise { const data = await response.json() as TwoDFanResponse; const html = data.subjects; + + console.log("2dfan API HTML Response:", html); const matches = html.matchAll(REGEX);