From 4d93d1b3e1ecdaf0b9aa77e1787033253e0eea07 Mon Sep 17 00:00:00 2001 From: Jurangren Date: Mon, 6 Oct 2025 22:09:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=95=E5=85=A5=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=B3=BB=E7=BB=9F=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BF=A1=E6=81=AF=E5=8F=8A=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入平台标签系统,提供详细的平台特性说明。 - 重构搜索结果初始化,避免平台名称重复定义。 - 修正核心搜索错误日志,确保正确记录平台名称。 - 移除两个Galgame平台:TianYouErCiYuan(收费)和YingZhiGuang(网站转型)。 - 更新部分平台的颜色、魔法属性和标签信息。 --- src/core.ts | 5 ++- src/platforms/gal/ACGYingYingGuai.ts | 2 +- src/platforms/gal/BiAnXingLu.ts | 2 +- src/platforms/gal/DaoHeGal.ts | 2 +- src/platforms/gal/FuFuACG.ts | 2 +- src/platforms/gal/GGBases.ts | 2 +- src/platforms/gal/GGS.ts | 2 +- src/platforms/gal/GalTuShuGuan.ts | 2 +- src/platforms/gal/GalgameX.ts | 2 +- src/platforms/gal/Hikarinagi.ts | 2 +- src/platforms/gal/JiMengACG.ts | 2 +- src/platforms/gal/Koyso.ts | 2 +- src/platforms/gal/KunGalgame.ts | 2 +- src/platforms/gal/LiSiTanACG.ts | 2 +- src/platforms/gal/LiangZiACG.ts | 2 +- src/platforms/gal/MaoMaoWangPan.ts | 2 +- src/platforms/gal/MiaoYuanLingYu.ts | 2 +- src/platforms/gal/Nysoure.ts | 4 +- src/platforms/gal/QingJiACG.ts | 2 +- src/platforms/gal/ShenShiTianTang.ts | 4 +- src/platforms/gal/TaoHuaYuan.ts | 2 +- src/platforms/gal/TianYouErCiYuan.ts | 57 ------------------------ src/platforms/gal/TouchGal.ts | 2 +- src/platforms/gal/VikaACG.ts | 4 +- src/platforms/gal/WeiZhiYunPan.ts | 2 +- src/platforms/gal/YingZhiGuang.ts | 59 ------------------------- src/platforms/gal/YouYuDeloli.ts | 2 +- src/platforms/gal/YueYao.ts | 2 +- src/platforms/gal/ZeroFive.ts | 2 +- src/platforms/gal/ZhenHongXiaoZhan.ts | 2 +- src/platforms/gal/ZiLingDeMiaoMiaoWu.ts | 2 +- src/platforms/gal/ZiYuanShe.ts | 2 +- src/platforms/gal/index.ts | 4 -- src/platforms/gal/xxacg.ts | 4 +- src/platforms/patch/KunGalgameBuDing.ts | 2 +- src/platforms/patch/TWOdfan.ts | 6 +-- src/types.ts | 4 +- 37 files changed, 44 insertions(+), 161 deletions(-) delete mode 100644 src/platforms/gal/TianYouErCiYuan.ts delete mode 100644 src/platforms/gal/YingZhiGuang.ts diff --git a/src/core.ts b/src/core.ts index d12c6bd..1114159 100644 --- a/src/core.ts +++ b/src/core.ts @@ -43,13 +43,14 @@ export async function handleSearchRequestStream( if (result.error) { // 记录平台错误 console.log(JSON.stringify({ - message: `平台 ${result.name} 搜索错误: ${result.error}`, + message: `平台 ${platform.name} 搜索错误: ${result.error}`, level: "error", })); } const streamResult: StreamResult = { - name: result.name, + name: platform.name, color: result.error ? 'red' : platform.color, + tags: platform.tags, items: result.items, error: result.error, }; diff --git a/src/platforms/gal/ACGYingYingGuai.ts b/src/platforms/gal/ACGYingYingGuai.ts index 507e084..8d381be 100644 --- a/src/platforms/gal/ACGYingYingGuai.ts +++ b/src/platforms/gal/ACGYingYingGuai.ts @@ -6,7 +6,6 @@ const REGEX = / { const searchResult: PlatformSearchResult = { - name: "ACG嘤嘤怪", count: 0, items: [], }; @@ -51,6 +50,7 @@ async function searchACGYingYingGuai(game: string): Promise

(?.*? async function searchBiAnXingLu(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "彼岸星露", count: 0, items: [], }; @@ -51,6 +50,7 @@ async function searchBiAnXingLu(game: string): Promise { const BiAnXingLu: Platform = { name: "彼岸星露", color: "lime", + tags: [], magic: false, search: searchBiAnXingLu, }; diff --git a/src/platforms/gal/DaoHeGal.ts b/src/platforms/gal/DaoHeGal.ts index 37e6691..d138e97 100644 --- a/src/platforms/gal/DaoHeGal.ts +++ b/src/platforms/gal/DaoHeGal.ts @@ -18,7 +18,6 @@ interface DaoHeGalResponse { async function searchDaoHeGal(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "稻荷GAL", count: 0, items: [], }; @@ -63,6 +62,7 @@ async function searchDaoHeGal(game: string): Promise { const DaoHeGal: Platform = { name: "稻荷GAL", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchDaoHeGal, }; diff --git a/src/platforms/gal/FuFuACG.ts b/src/platforms/gal/FuFuACG.ts index 43f1d89..640d20a 100644 --- a/src/platforms/gal/FuFuACG.ts +++ b/src/platforms/gal/FuFuACG.ts @@ -15,7 +15,6 @@ interface FuFuACGResponse { async function searchFuFuACG(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "FuFuACG", count: 0, items: [], }; @@ -59,6 +58,7 @@ async function searchFuFuACG(game: string): Promise { const FuFuACG: Platform = { name: "FuFuACG", color: "white", + tags: ["LoginPay"], magic: false, search: searchFuFuACG, }; diff --git a/src/platforms/gal/GGBases.ts b/src/platforms/gal/GGBases.ts index 232abaa..63cf1b2 100644 --- a/src/platforms/gal/GGBases.ts +++ b/src/platforms/gal/GGBases.ts @@ -7,7 +7,6 @@ const REGEX = / { const GGBases: Platform = { name: "GGBases", color: "lime", + tags: ["NoReq", "BTmag"], magic: false, search: searchGGBases, }; diff --git a/src/platforms/gal/GGS.ts b/src/platforms/gal/GGS.ts index d57f223..5a47e75 100644 --- a/src/platforms/gal/GGS.ts +++ b/src/platforms/gal/GGS.ts @@ -11,7 +11,6 @@ interface GgsItem { async function searchGGS(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "GGS", count: 0, items: [], }; @@ -49,6 +48,7 @@ async function searchGGS(game: string): Promise { const GGS: Platform = { name: "GGS", color: "lime", + tags: ["NoReq"], magic: false, search: searchGGS, }; diff --git a/src/platforms/gal/GalTuShuGuan.ts b/src/platforms/gal/GalTuShuGuan.ts index 5f60bb9..5914f79 100644 --- a/src/platforms/gal/GalTuShuGuan.ts +++ b/src/platforms/gal/GalTuShuGuan.ts @@ -21,7 +21,6 @@ function stripHtml(html: string): string { async function searchGalTuShuGuan(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "GAL图书馆", count: 0, items: [], }; @@ -81,6 +80,7 @@ async function searchGalTuShuGuan(game: string): Promise { const GalTuShuGuan: Platform = { name: "GAL图书馆", color: "lime", + tags: ["NoReq", "SplDrive"], magic: false, search: searchGalTuShuGuan, }; diff --git a/src/platforms/gal/GalgameX.ts b/src/platforms/gal/GalgameX.ts index a7e63cb..e35000e 100644 --- a/src/platforms/gal/GalgameX.ts +++ b/src/platforms/gal/GalgameX.ts @@ -15,7 +15,6 @@ interface GalgameXResponse { async function searchGalgameX(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "Galgamex", count: 0, items: [], }; @@ -76,6 +75,7 @@ async function searchGalgameX(game: string): Promise { const GalgameX: Platform = { name: "Galgamex", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchGalgameX, }; diff --git a/src/platforms/gal/Hikarinagi.ts b/src/platforms/gal/Hikarinagi.ts index 28f0b88..5cac60c 100644 --- a/src/platforms/gal/Hikarinagi.ts +++ b/src/platforms/gal/Hikarinagi.ts @@ -6,7 +6,6 @@ const REGEX = /" class="lazyload fit-cover radius8">.*?

async function searchHikarinagi(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "Hikarinagi", count: 0, items: [], }; @@ -51,6 +50,7 @@ async function searchHikarinagi(game: string): Promise { const Hikarinagi: Platform = { name: "Hikarinagi", color: "white", + tags: ["LoginPay", "SuDrive"], magic: false, search: searchHikarinagi, }; diff --git a/src/platforms/gal/JiMengACG.ts b/src/platforms/gal/JiMengACG.ts index ef1c8a4..2d3a9bf 100644 --- a/src/platforms/gal/JiMengACG.ts +++ b/src/platforms/gal/JiMengACG.ts @@ -17,7 +17,6 @@ interface JiMengACGResponse { async function searchJiMengACG(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "绮梦ACG", count: 0, items: [], }; @@ -63,6 +62,7 @@ async function searchJiMengACG(game: string): Promise { const JiMengACG: Platform = { name: "绮梦ACG", color: "lime", + tags: ["Rep", "SuDrive"], magic: false, search: searchJiMengACG, }; diff --git a/src/platforms/gal/Koyso.ts b/src/platforms/gal/Koyso.ts index a5964ea..52722fe 100644 --- a/src/platforms/gal/Koyso.ts +++ b/src/platforms/gal/Koyso.ts @@ -7,7 +7,6 @@ const REGEX = /.*? { const Koyso: Platform = { name: "Koyso", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchKoyso, }; diff --git a/src/platforms/gal/KunGalgame.ts b/src/platforms/gal/KunGalgame.ts index f2e108d..720c4bd 100644 --- a/src/platforms/gal/KunGalgame.ts +++ b/src/platforms/gal/KunGalgame.ts @@ -14,7 +14,6 @@ interface KunGalgameItem { async function searchKunGalgame(game: string): Promise { const searchResult: PlatformSearchResult = { - name: "鲲Galgame", count: 0, items: [], }; @@ -60,6 +59,7 @@ async function searchKunGalgame(game: string): Promise { const KunGalgame: Platform = { name: "鲲Galgame", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchKunGalgame, }; diff --git a/src/platforms/gal/LiSiTanACG.ts b/src/platforms/gal/LiSiTanACG.ts index 6039c6b..e912210 100644 --- a/src/platforms/gal/LiSiTanACG.ts +++ b/src/platforms/gal/LiSiTanACG.ts @@ -7,7 +7,6 @@ const REGEX = /.*?(.*?)<\/title>.*?<url>(.*?)<\/url>.*?<\/entry>/g async function searchLiSiTanACG(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "莉斯坦ACG", count: 0, items: [], }; @@ -52,6 +51,7 @@ async function searchLiSiTanACG(game: string): Promise<PlatformSearchResult> { const LiSiTanACG: Platform = { name: "莉斯坦ACG", color: "lime", + tags: ["NoReq", "NoSplDrive"], magic: false, search: searchLiSiTanACG, }; diff --git a/src/platforms/gal/LiangZiACG.ts b/src/platforms/gal/LiangZiACG.ts index 234574c..c12d73d 100644 --- a/src/platforms/gal/LiangZiACG.ts +++ b/src/platforms/gal/LiangZiACG.ts @@ -6,7 +6,6 @@ const REGEX = />\s*<h2 class="item-heading"><a target="_blank" href="(?<URL>.*?) async function searchLiangZiACG(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "量子acg", count: 0, items: [], }; @@ -51,6 +50,7 @@ async function searchLiangZiACG(game: string): Promise<PlatformSearchResult> { const LiangZiACG: Platform = { name: "量子acg", color: "white", + tags: ["NoReq", "SuDrive"], magic: false, search: searchLiangZiACG, }; diff --git a/src/platforms/gal/MaoMaoWangPan.ts b/src/platforms/gal/MaoMaoWangPan.ts index 9956cf2..149a37b 100644 --- a/src/platforms/gal/MaoMaoWangPan.ts +++ b/src/platforms/gal/MaoMaoWangPan.ts @@ -19,7 +19,6 @@ interface MaoMaoResponse { async function searchMaoMaoWangPan(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "猫猫网盘", count: 0, items: [], }; @@ -77,6 +76,7 @@ async function searchMaoMaoWangPan(game: string): Promise<PlatformSearchResult> const MaoMaoWangPan: Platform = { name: "猫猫网盘", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchMaoMaoWangPan, }; diff --git a/src/platforms/gal/MiaoYuanLingYu.ts b/src/platforms/gal/MiaoYuanLingYu.ts index f5ff9b3..e805633 100644 --- a/src/platforms/gal/MiaoYuanLingYu.ts +++ b/src/platforms/gal/MiaoYuanLingYu.ts @@ -6,7 +6,6 @@ const REGEX = /<div class="item-thumbnail">\s*<a target="_blank" href="(?<URL>.* async function searchMiaoYuanLingYu(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "喵源领域", count: 0, items: [], }; @@ -56,6 +55,7 @@ async function searchMiaoYuanLingYu(game: string): Promise<PlatformSearchResult> const MiaoYuanLingYu: Platform = { name: "喵源领域", color: "white", + tags: ["Login", "SuDrive"], magic: false, search: searchMiaoYuanLingYu, }; diff --git a/src/platforms/gal/Nysoure.ts b/src/platforms/gal/Nysoure.ts index 1b7dd5a..6335dee 100644 --- a/src/platforms/gal/Nysoure.ts +++ b/src/platforms/gal/Nysoure.ts @@ -16,7 +16,6 @@ interface NysoureResponse { async function searchNysoure(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "Nysoure", count: 0, items: [], }; @@ -59,7 +58,8 @@ async function searchNysoure(game: string): Promise<PlatformSearchResult> { const Nysoure: Platform = { name: "Nysoure", - color: "gold", + color: "lime", + tags: ["NoReq", "magic", "SuDrive"], magic: true, search: searchNysoure, }; diff --git a/src/platforms/gal/QingJiACG.ts b/src/platforms/gal/QingJiACG.ts index 106c31b..36ec732 100644 --- a/src/platforms/gal/QingJiACG.ts +++ b/src/platforms/gal/QingJiACG.ts @@ -6,7 +6,6 @@ const REGEX = /" class="lazyload fit-cover radius8">.*?<h2 class="item-heading"> async function searchQingJiACG(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "青桔ACG", count: 0, items: [], }; @@ -57,6 +56,7 @@ async function searchQingJiACG(game: string): Promise<PlatformSearchResult> { const QingJiACG: Platform = { name: "青桔ACG", color: "lime", + tags: ["NoReq", "SplDrive"], magic: false, search: searchQingJiACG, }; diff --git a/src/platforms/gal/ShenShiTianTang.ts b/src/platforms/gal/ShenShiTianTang.ts index e7a5a57..37171ac 100644 --- a/src/platforms/gal/ShenShiTianTang.ts +++ b/src/platforms/gal/ShenShiTianTang.ts @@ -6,7 +6,6 @@ const REGEX = /<h2 class="post-list-title">\s*<a href="(?<URL>.*?)" title=".+?" async function searchShenShiTianTang(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "绅仕天堂", count: 0, items: [], }; @@ -50,7 +49,8 @@ async function searchShenShiTianTang(game: string): Promise<PlatformSearchResult const ShenShiTianTang: Platform = { name: "绅仕天堂", - color: "gold", + color: "white", + tags: ["Login", "magic", "SuDrive"], magic: true, search: searchShenShiTianTang, }; diff --git a/src/platforms/gal/TaoHuaYuan.ts b/src/platforms/gal/TaoHuaYuan.ts index 125c3df..4750270 100644 --- a/src/platforms/gal/TaoHuaYuan.ts +++ b/src/platforms/gal/TaoHuaYuan.ts @@ -10,7 +10,6 @@ interface TaoHuaYuanItem { async function searchTaoHuaYuan(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "桃花源", count: 0, items: [], }; @@ -48,6 +47,7 @@ async function searchTaoHuaYuan(game: string): Promise<PlatformSearchResult> { const TaoHuaYuan: Platform = { name: "桃花源", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchTaoHuaYuan, }; diff --git a/src/platforms/gal/TianYouErCiYuan.ts b/src/platforms/gal/TianYouErCiYuan.ts deleted file mode 100644 index e087127..0000000 --- a/src/platforms/gal/TianYouErCiYuan.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { fetchClient } from "../../utils/httpClient"; -import type { Platform, PlatformSearchResult, SearchResultItem } from "../../types"; - -const API_URL = "https://www.tiangal.com/search/"; -const REGEX = /<\/i><\/a><h2><a href="(?<URL>.*?)" title="(?<NAME>.*?)"/gs; - -async function searchTianYouErCiYuan(game: string): Promise<PlatformSearchResult> { - const searchResult: PlatformSearchResult = { - name: "天游二次元", - count: 0, - items: [], - }; - - try { - const url = new URL(API_URL + encodeURIComponent(game)); // URL path parameter - - const response = await fetchClient(url); - if (!response.ok) { - throw new Error(`资源平台 SearchAPI 响应异常状态码 ${response.status}`); - } - - const html = await response.text(); - const matches = html.matchAll(REGEX); - - const items: SearchResultItem[] = []; - for (const match of matches) { - if (match.groups?.NAME && match.groups?.URL) { - items.push({ - name: match.groups.NAME.trim(), - url: match.groups.URL, - }); - } - } - - searchResult.items = items; - searchResult.count = items.length; - - } catch (error) { - if (error instanceof Error) { - searchResult.error = error.message; - } else { - searchResult.error = "An unknown error occurred"; - } - searchResult.count = -1; - } - - return searchResult; -} - -const TianYouErCiYuan: Platform = { - name: "天游二次元", - color: "gold", - magic: true, - search: searchTianYouErCiYuan, -}; - -export default TianYouErCiYuan; \ No newline at end of file diff --git a/src/platforms/gal/TouchGal.ts b/src/platforms/gal/TouchGal.ts index c829e30..e6726ab 100644 --- a/src/platforms/gal/TouchGal.ts +++ b/src/platforms/gal/TouchGal.ts @@ -6,7 +6,6 @@ const BASE_URL = "https://www.touchgal.us/"; async function searchTouchGal(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "TouchGal", count: 0, items: [], }; @@ -67,6 +66,7 @@ async function searchTouchGal(game: string): Promise<PlatformSearchResult> { const TouchGal: Platform = { name: "TouchGal", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchTouchGal, }; diff --git a/src/platforms/gal/VikaACG.ts b/src/platforms/gal/VikaACG.ts index 286b764..50489ec 100644 --- a/src/platforms/gal/VikaACG.ts +++ b/src/platforms/gal/VikaACG.ts @@ -6,7 +6,6 @@ const REGEX = /<h2><a target="_blank" href="(?<URL>.*?)">(?<NAME>.*?)<\/a>/gs; async function searchVikaACG(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "VikaACG", count: 0, items: [], }; @@ -81,7 +80,8 @@ async function searchVikaACG(game: string): Promise<PlatformSearchResult> { const VikaACG: Platform = { name: "VikaACG", - color: "gold", + color: "white", + tags: ["LoginPay", "magic", "MixDrive"], magic: true, search: searchVikaACG, }; diff --git a/src/platforms/gal/WeiZhiYunPan.ts b/src/platforms/gal/WeiZhiYunPan.ts index 3d3f4a2..cda08e8 100644 --- a/src/platforms/gal/WeiZhiYunPan.ts +++ b/src/platforms/gal/WeiZhiYunPan.ts @@ -19,7 +19,6 @@ interface WeiZhiYunPanResponse { async function searchWeiZhiYunPan(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "未知云盘", count: 0, items: [], }; @@ -75,6 +74,7 @@ async function searchWeiZhiYunPan(game: string): Promise<PlatformSearchResult> { const WeiZhiYunPan: Platform = { name: "未知云盘", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchWeiZhiYunPan, }; diff --git a/src/platforms/gal/YingZhiGuang.ts b/src/platforms/gal/YingZhiGuang.ts deleted file mode 100644 index db5845c..0000000 --- a/src/platforms/gal/YingZhiGuang.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { fetchClient } from "../../utils/httpClient"; -import type { Platform, PlatformSearchResult, SearchResultItem } from "../../types"; - -const DATA_URL = "https://yinghu.netlify.app/search.xml"; -const BASE_URL = "https://yinghu.netlify.app"; -const REGEX = /<entry>.*?<title>(.*?)<\/title>.*?<url>(.*?)<\/url>.*?<\/entry>/gs; - -async function searchYingZhiGuang(game: string): Promise<PlatformSearchResult> { - const searchResult: PlatformSearchResult = { - name: "萤ノ光", - count: 0, - items: [], - }; - - try { - const response = await fetchClient(DATA_URL); - if (!response.ok) { - throw new Error(`Failed to fetch data from ${DATA_URL}`); - } - - const xmlText = await response.text(); - const matches = xmlText.matchAll(REGEX); - - const items: SearchResultItem[] = []; - for (const match of matches) { - const title = match[1]; - const urlPath = match[2]; - - if (title && urlPath && title.includes(game)) { - items.push({ - name: title.trim(), - url: BASE_URL + urlPath, - }); - } - } - - searchResult.items = items; - searchResult.count = items.length; - - } catch (error) { - if (error instanceof Error) { - searchResult.error = error.message; - } else { - searchResult.error = "An unknown error occurred"; - } - searchResult.count = -1; - } - - return searchResult; -} - -const YingZhiGuang: Platform = { - name: "萤ノ光", - color: "lime", - magic: false, - search: searchYingZhiGuang, -}; - -export default YingZhiGuang; \ No newline at end of file diff --git a/src/platforms/gal/YouYuDeloli.ts b/src/platforms/gal/YouYuDeloli.ts index ca8da51..9a380a0 100644 --- a/src/platforms/gal/YouYuDeloli.ts +++ b/src/platforms/gal/YouYuDeloli.ts @@ -6,7 +6,6 @@ const REGEX = /<p style="text-align: center;"> <a href=".*?" target="_blank">.*? async function searchYouYuDeloli(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "忧郁的loli", count: 0, items: [], }; @@ -54,6 +53,7 @@ async function searchYouYuDeloli(game: string): Promise<PlatformSearchResult> { const YouYuDeloli: Platform = { name: "忧郁的loli", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchYouYuDeloli, }; diff --git a/src/platforms/gal/YueYao.ts b/src/platforms/gal/YueYao.ts index c50ef2b..a490b1c 100644 --- a/src/platforms/gal/YueYao.ts +++ b/src/platforms/gal/YueYao.ts @@ -7,7 +7,6 @@ const REGEX = /<entry>.*?<title>(.*?)<\/title>.*?<url>(.*?)<\/url>.*?<\/entry>/g async function searchYueYao(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "月谣", count: 0, items: [], }; @@ -52,6 +51,7 @@ async function searchYueYao(game: string): Promise<PlatformSearchResult> { const YueYao: Platform = { name: "月谣", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchYueYao, }; diff --git a/src/platforms/gal/ZeroFive.ts b/src/platforms/gal/ZeroFive.ts index 1917f5c..2c03814 100644 --- a/src/platforms/gal/ZeroFive.ts +++ b/src/platforms/gal/ZeroFive.ts @@ -19,7 +19,6 @@ interface ZeroFiveResponse { async function searchZeroFive(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "05的资源小站", count: 0, items: [], }; @@ -75,6 +74,7 @@ async function searchZeroFive(game: string): Promise<PlatformSearchResult> { const ZeroFive: Platform = { name: "05的资源小站", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchZeroFive, }; diff --git a/src/platforms/gal/ZhenHongXiaoZhan.ts b/src/platforms/gal/ZhenHongXiaoZhan.ts index 779ea10..953f05b 100644 --- a/src/platforms/gal/ZhenHongXiaoZhan.ts +++ b/src/platforms/gal/ZhenHongXiaoZhan.ts @@ -7,7 +7,6 @@ const REGEX = /hover:underline" href="(?<URL>.+?)">\s*(?<NAME>.+?)\s*<\/a>/gs; async function searchZhenHongXiaoZhan(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "真红小站", count: 0, items: [], }; @@ -52,6 +51,7 @@ async function searchZhenHongXiaoZhan(game: string): Promise<PlatformSearchResul const ZhenHongXiaoZhan: Platform = { name: "真红小站", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchZhenHongXiaoZhan, }; diff --git a/src/platforms/gal/ZiLingDeMiaoMiaoWu.ts b/src/platforms/gal/ZiLingDeMiaoMiaoWu.ts index c307cc6..75ae756 100644 --- a/src/platforms/gal/ZiLingDeMiaoMiaoWu.ts +++ b/src/platforms/gal/ZiLingDeMiaoMiaoWu.ts @@ -19,7 +19,6 @@ interface ZiLingDeMiaoMiaoWuResponse { async function searchZiLingDeMiaoMiaoWu(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "梓澪の妙妙屋", count: 0, items: [], }; @@ -75,6 +74,7 @@ async function searchZiLingDeMiaoMiaoWu(game: string): Promise<PlatformSearchRes const ZiLingDeMiaoMiaoWu: Platform = { name: "梓澪の妙妙屋", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchZiLingDeMiaoMiaoWu, }; diff --git a/src/platforms/gal/ZiYuanShe.ts b/src/platforms/gal/ZiYuanShe.ts index b1709c1..f425e7a 100644 --- a/src/platforms/gal/ZiYuanShe.ts +++ b/src/platforms/gal/ZiYuanShe.ts @@ -5,7 +5,6 @@ const BASE_URL = "https://galzy.eu.org"; async function searchZiYuanShe(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "紫缘Gal", count: 0, items: [], }; @@ -61,6 +60,7 @@ async function searchZiYuanShe(game: string): Promise<PlatformSearchResult> { const ZiYuanShe: Platform = { name: "紫缘Gal", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchZiYuanShe, }; diff --git a/src/platforms/gal/index.ts b/src/platforms/gal/index.ts index 0ae4d8a..10ce314 100644 --- a/src/platforms/gal/index.ts +++ b/src/platforms/gal/index.ts @@ -19,12 +19,10 @@ import Nysoure from "./Nysoure"; import QingJiACG from "./QingJiACG"; import ShenShiTianTang from "./ShenShiTianTang"; import TaoHuaYuan from "./TaoHuaYuan"; -import TianYouErCiYuan from "./TianYouErCiYuan"; import TouchGal from "./TouchGal"; import VikaACG from "./VikaACG"; import WeiZhiYunPan from "./WeiZhiYunPan"; import xxacg from "./xxacg"; -import YingZhiGuang from "./YingZhiGuang"; import YouYuDeloli from "./YouYuDeloli"; import YueYao from "./YueYao"; import ZeroFive from "./ZeroFive"; @@ -53,12 +51,10 @@ const platforms: Platform[] = [ QingJiACG, ShenShiTianTang, TaoHuaYuan, - TianYouErCiYuan, TouchGal, VikaACG, WeiZhiYunPan, xxacg, - YingZhiGuang, YouYuDeloli, YueYao, ZeroFive, diff --git a/src/platforms/gal/xxacg.ts b/src/platforms/gal/xxacg.ts index 1f762cb..35af273 100644 --- a/src/platforms/gal/xxacg.ts +++ b/src/platforms/gal/xxacg.ts @@ -9,7 +9,6 @@ function stripHtml(html: string): string { async function searchXxacg(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "xxacg", count: 0, items: [], }; @@ -56,7 +55,8 @@ async function searchXxacg(game: string): Promise<PlatformSearchResult> { const xxacg: Platform = { name: "xxacg", - color: "gold", + color: "white", + tags: ["Login", "magic", "NoSplDrive"], magic: true, search: searchXxacg, }; diff --git a/src/platforms/patch/KunGalgameBuDing.ts b/src/platforms/patch/KunGalgameBuDing.ts index 1bd3532..5bd3eb4 100644 --- a/src/platforms/patch/KunGalgameBuDing.ts +++ b/src/platforms/patch/KunGalgameBuDing.ts @@ -15,7 +15,6 @@ interface KunGalgameBuDingResponse { async function searchKunGalgameBuDing(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "鲲Galgame补丁", count: 0, items: [], }; @@ -69,6 +68,7 @@ async function searchKunGalgameBuDing(game: string): Promise<PlatformSearchResul const KunGalgameBuDing: Platform = { name: "鲲Galgame补丁", color: "lime", + tags: ["NoReq", "SuDrive"], magic: false, search: searchKunGalgameBuDing, }; diff --git a/src/platforms/patch/TWOdfan.ts b/src/platforms/patch/TWOdfan.ts index 5fa81c6..d093850 100644 --- a/src/platforms/patch/TWOdfan.ts +++ b/src/platforms/patch/TWOdfan.ts @@ -7,7 +7,6 @@ const REGEX = /<h4 class="media-heading"><a target="_blank" href="(?<URL>.*?)">( async function searchTWOdfan(game: string): Promise<PlatformSearchResult> { const searchResult: PlatformSearchResult = { - name: "2dfan", count: 0, items: [], }; @@ -52,8 +51,9 @@ async function searchTWOdfan(game: string): Promise<PlatformSearchResult> { const TWOdfan: Platform = { name: "2dfan", - color: "lime", - magic: false, + color: "white", + tags: ["LoginPay", "magic", "MixDrive"], + magic: true, search: searchTWOdfan, }; diff --git a/src/types.ts b/src/types.ts index c5b11e4..4142db3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2,13 +2,13 @@ export interface SearchResultItem { name: string; url: string; + tags?: string[]; } // 平台搜索的返回值 export interface PlatformSearchResult { items: SearchResultItem[]; count: number; - name: string; error?: string; } @@ -16,6 +16,7 @@ export interface PlatformSearchResult { export interface Platform { name: string; color: string; + tags: string[]; magic: boolean; search: (game: string, ...args: any[]) => Promise<PlatformSearchResult>; } @@ -24,6 +25,7 @@ export interface Platform { export interface StreamResult { name: string; color: string; + tags: string[]; items: SearchResultItem[]; error?: string; }