From 00f41c3c985f2a574751353d2099f8caa5375809 Mon Sep 17 00:00:00 2001 From: "DESKTOP-I4SRUE6\\NikoYoke" Date: Sat, 19 Oct 2024 18:24:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8E=88pref=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?#rnq=E5=88=A4=E6=96=AD/=E6=B7=BB=E5=8A=A0=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 4e030fc..fa5dd97 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1571,8 +1571,13 @@ export class tools extends plugin { try { // 优先判断是否使用自建 API const isOversea = await this.isOverseasServer(); - const autoSelectNeteaseApi = this.useLocalNeteaseAPI ? this.neteaseCloudAPIServer : (isOversea ? NETEASE_SONG_DOWNLOAD : NETEASE_API_CN); - + let autoSelectNeteaseApi + if (this.useLocalNeteaseAPI) { + autoSelectNeteaseApi = this.neteaseCloudAPIServer + } else { + autoSelectNeteaseApi = (isOversea ? NETEASE_SONG_DOWNLOAD : NETEASE_API_CN) + await e.reply('未使用自建服务器,高概率#rnq失败'); + } // 获取登录key const keyUrl = `${autoSelectNeteaseApi}/login/qr/key`; const keyResponse = await axios.get(keyUrl, { headers: { "User-Agent": COMMON_USER_AGENT } }); @@ -1590,8 +1595,16 @@ export class tools extends plugin { // 轮询检查登录状态 await this.pollLoginStatus(autoSelectNeteaseApi, unikey, e); } catch (error) { - logger.error('执行网易云扫码登录时出错:', error); - e.reply('执行扫码登录时发生错误,请稍后再试'); + if (error.code == 'ERR_INVALID_URL') { + logger.error('执行网易云扫码登录时出错:非法地址,请检查API服务地址', error); + e.reply(`执行网易云扫码登录时出错${error.code}请检查API服务器地址`); + } else if (error.code == 'ECONNRESET') { + logger.error('执行网易云扫码登录时出错:API请求错误,请检查API服务状态', error); + e.reply(`执行扫码登录时发生错误${error.code}请检查API服务状态`); + } else { + logger.error('执行网易云扫码登录时出错:', error); + e.reply('执行扫码登录时发生错误,请稍后再试'); + } } } From d1eae616f210d85324c6ff5fd838884a29bd160d Mon Sep 17 00:00:00 2001 From: "DESKTOP-I4SRUE6\\NikoYoke" Date: Sat, 19 Oct 2024 18:57:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9E=20fix=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=AA=E5=88=AB=E6=AD=8C=E6=9B=B2=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tools.js b/apps/tools.js index fa5dd97..3e4960c 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1664,7 +1664,7 @@ export class tools extends plugin { } }) // mv截断 - if (message.includes("mv")) { + if (/mv\?/.test(message)) { const AUTO_NETEASE_MV_DETAIL = autoSelectNeteaseApi + "/mv/detail?mvid={}"; const AUTO_NETEASE_MV_URL = autoSelectNeteaseApi + "/mv/url?id={}"; // logger.info(AUTO_NETEASE_MV_DETAIL.replace("{}", id));