1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

添加 assistant 助手;其他调整(大调整)

This commit is contained in:
2022-10-29 00:16:36 +08:00
parent ddde1b28f9
commit ce20720c60
21 changed files with 973 additions and 115 deletions

View File

@@ -75,17 +75,21 @@ async function startFetchDetail() {
const threadId = idsToFetch[i];
console.log(`getDetail\t| ${i + 1}/${idsToFetch.length} | threadId: ${threadId}`);
await getDetail(threadId);
await sleepUtils.sleep(1000);
}
}
async function getDetail(threadId) {
let url = `https://hifini.com/thread-${threadId}.htm`;
// let html = fs.readFileSync("./1.html", "utf8");
let html = await getApiResult(url);
// fs.writeFileSync("./1.html", html);
let html;
try {
// html = fs.readFileSync("./1.html", "utf8");
html = await getApiResult(url, { timeout: 3000 });
// fs.writeFileSync("./1.html", html);
} catch (e) {
console.error("请求失败,可能是请求超时", e);
return;
}
// 解析到音乐信息
var matcher = /var ap4 = new APlayer\(([\S\s]*?)\);/.exec(html);