refactor: 重构紫缘社搜索并移除密码参数

* 移除 `zypassword` 参数,简化核心搜索函数接口。
* 紫缘社搜索逻辑重构,改为解析HTML获取数据,不再依赖API。
* 更新紫缘社平台名称为“紫缘社”,并调整其显示颜色。
* 优化紫缘社搜索结果的标题提取,优先使用中文标题。
This commit is contained in:
Jurangren
2025-10-05 18:10:49 +08:00
parent eed68a9a4d
commit 29f4e0c67c
3 changed files with 31 additions and 56 deletions

View File

@@ -12,7 +12,6 @@ async function handleSearch(request: Request, env: Env, ctx: ExecutionContext, p
try {
const formData = await request.formData();
const game = formData.get("game") as string;
const zypassword = formData.get("zypassword") as string || ""; // 获取 zypassword
if (!game || typeof game !== 'string') {
@@ -27,7 +26,7 @@ async function handleSearch(request: Request, env: Env, ctx: ExecutionContext, p
// 将异步任务交给 waitUntil 来处理,确保它能完整执行
ctx.waitUntil(
handleSearchRequestStream(game.trim(), platforms, writer, zypassword) // 传递 zypassword
handleSearchRequestStream(game.trim(), platforms, writer)
.catch(err => console.error("Streaming error:", err))
.finally(() => writer.close())
);