From 3f1464be2388132b54bbdac53d14237052c14b18 Mon Sep 17 00:00:00 2001 From: Tianpao Date: Sat, 28 Sep 2024 01:16:10 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20PATCH/mainx.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PATCH/mainx.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 PATCH/mainx.js diff --git a/PATCH/mainx.js b/PATCH/mainx.js deleted file mode 100644 index 637b655..0000000 --- a/PATCH/mainx.js +++ /dev/null @@ -1,31 +0,0 @@ -; (async () => { - let offset = 0 - let max - while (true) { - let re = await fetch(`https://api.modrinth.com/v2/search?limit=100&offset=${offset}&index=relevance&facets=[[%22project_type:mod%22]]`) - let res = await re.json() - if (re.status < 200 || re.status > 299) return (() => {console.log(re.status);console.log(res)})() - max = res.total_hits - console.log(`爬取成功 偏移量 ${offset}, 总量 ${max}`) - offset += 100 - // slug: modid, client_side && server_side - for (let ii of Object.keys(res.hits)) { - let i = res.hits[ii] - let t = (() => { - if (i.server_side == 'unsupported') - return 'false' - if (i.client_side == 'unsupported') - return 'true' - return 'trlse' - })() - console.log(`模组 ${i.slug} 类型为 ${t}`) - fetch(`http://154.201.72.75:3009/modid?modid=${i.slug}&client=${t}`).then((r) => { - if (r.status >= 200 && r.status <= 299) - console.log(`模组 ${i.slug} 提交成功为 ${t}`) - else - console.log(`模组 ${i.slug} 提交失败为 ${t}`) - }) - } - if (offset > max) break - } -})()