🐞 fix: 修复netease无法解析歌曲问题

This commit is contained in:
zhiyu1998 2024-05-30 21:52:12 +08:00
parent 4b9e533f4e
commit a9a1faba83
2 changed files with 13 additions and 6 deletions

View File

@ -56,7 +56,7 @@ import {
GENERAL_REQ_LINK,
MIYOUSHE_ARTICLE,
NETEASE_SONG_DETAIL,
NETEASE_SONG_DOWNLOAD,
NETEASE_SONG_DOWNLOAD, NETEASE_TEMP_API,
TIKTOK_INFO,
TWITTER_TWEET_INFO,
WEIBO_SINGLE_INFO,
@ -1012,15 +1012,16 @@ export class tools extends plugin {
// 一般这个情况是VIP歌曲
if (url == null) {
// 临时接口
const vipMusicData = await axios.get(`https://www.hhlqilongzhu.cn/api/dg_wyymusic.php?gm=${ title }&n=1&type=json`, {
const vipMusicData = await axios.get(NETEASE_TEMP_API.replace("{}", title), {
headers: {
"User-Agent":
"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36",
},
});
const messageTitle = title + "\nR插件检测到当前为VIP音乐正在转换...";
url = vipMusicData.data.music_url;
e.reply(`识别:网易云音乐,${ messageTitle }`);
url = vipMusicData.data.mp3;
const cover = vipMusicData.data.img;
e.reply([segment.image(cover), `识别:网易云音乐,${ messageTitle }`]);
} else {
// 不是VIP歌曲直接识别完就下一步
e.reply(`识别:网易云音乐,${ title }`);
@ -1481,13 +1482,13 @@ export class tools extends plugin {
// 国内服务器解决方案
if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
// 临时接口
const vipMusicData = await axios.get(`https://www.hhlqilongzhu.cn/api/dg_wyymusic.php?gm=${ title }&n=1&type=json`, {
const vipMusicData = await axios.get(NETEASE_TEMP_API.replace("{}", title), {
headers: {
"User-Agent":
"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36",
},
});
const url = vipMusicData.data.music_url;
const url = vipMusicData.data.mp3;
// 下载音乐
downloadMp3(url, this.getCurDownloadPath(e), title, 'follow').then(async path => {
// 发送语音

View File

@ -121,6 +121,12 @@ export const NETEASE_SONG_DOWNLOAD = "https://neteasecloudmusicapi.vercel.app/so
*/
export const NETEASE_SONG_DETAIL = "https://neteasecloudmusicapi.vercel.app/song/detail?ids={}"
/**
* 下载VIP的临时接口 (感谢桑帛云API如果站长能看到)
* @type {string}
*/
export const NETEASE_TEMP_API = "https://api.lolimi.cn/API/wydg/api.php?msg={}&n=1"
/**
* 单条微博的接口
* @type {string}