mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
commit
b1b702a819
@ -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,10 +1595,18 @@ export class tools extends plugin {
|
||||
// 轮询检查登录状态
|
||||
await this.pollLoginStatus(autoSelectNeteaseApi, unikey, e);
|
||||
} catch (error) {
|
||||
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('执行扫码登录时发生错误,请稍后再试');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 网易云解析
|
||||
async netease(e) {
|
||||
@ -1651,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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user