mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🦄 reactor: 重构Soda Music
解析
This commit is contained in:
parent
523bca933e
commit
129ea7ef20
@ -38,7 +38,7 @@ import {
|
|||||||
MIYOUSHE_ARTICLE,
|
MIYOUSHE_ARTICLE,
|
||||||
NETEASE_API_CN,
|
NETEASE_API_CN,
|
||||||
NETEASE_SONG_DOWNLOAD,
|
NETEASE_SONG_DOWNLOAD,
|
||||||
NETEASE_TEMP_API,
|
NETEASE_TEMP_API, QISHUI_MUSIC_TEMP_API,
|
||||||
QQ_MUSIC_TEMP_API,
|
QQ_MUSIC_TEMP_API,
|
||||||
TWITTER_TWEET_INFO,
|
TWITTER_TWEET_INFO,
|
||||||
WEIBO_SINGLE_INFO,
|
WEIBO_SINGLE_INFO,
|
||||||
@ -1308,7 +1308,12 @@ export class tools extends plugin {
|
|||||||
|
|
||||||
// 临时接口
|
// 临时接口
|
||||||
async musicTempApi(e, title, musicType) {
|
async musicTempApi(e, title, musicType) {
|
||||||
let musicReqApi = musicType === "QQ音乐" ? QQ_MUSIC_TEMP_API : NETEASE_TEMP_API;
|
let musicReqApi = NETEASE_TEMP_API;
|
||||||
|
if (musicType === "QQ音乐") {
|
||||||
|
musicReqApi = QQ_MUSIC_TEMP_API;
|
||||||
|
} else if (musicType === "汽水音乐") {
|
||||||
|
musicReqApi = QISHUI_MUSIC_TEMP_API;
|
||||||
|
}
|
||||||
// 临时接口,title经过变换后搜索到的音乐质量提升
|
// 临时接口,title经过变换后搜索到的音乐质量提升
|
||||||
const vipMusicData = await axios.get(musicReqApi.replace("{}", title.replace("-", " ")), {
|
const vipMusicData = await axios.get(musicReqApi.replace("{}", title.replace("-", " ")), {
|
||||||
headers: {
|
headers: {
|
||||||
@ -1316,9 +1321,9 @@ export class tools extends plugin {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const messageTitle = title + "\nR插件检测到当前为VIP音乐,正在转换...";
|
const messageTitle = title + "\nR插件检测到当前为VIP音乐,正在转换...";
|
||||||
// ??后的内容是适配`QQ_MUSIC_TEMP_API`
|
// ??后的内容是适配`QQ_MUSIC_TEMP_API`、最后是汽水
|
||||||
const url = vipMusicData.data.mp3 ?? vipMusicData.data.data.url;
|
const url = vipMusicData.data?.mp3 ?? vipMusicData.data?.data?.url ?? vipMusicData.data?.music;
|
||||||
const cover = vipMusicData.data.img ?? vipMusicData.data.data.cover;
|
const cover = vipMusicData.data?.img ?? vipMusicData.data?.data?.cover ?? vipMusicData.data?.cover;
|
||||||
await e.reply([segment.image(cover), `${ this.identifyPrefix } 识别:${ musicType },${ messageTitle }`]);
|
await e.reply([segment.image(cover), `${ this.identifyPrefix } 识别:${ musicType },${ messageTitle }`]);
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,12 @@ export const NETEASE_TEMP_API = "https://api.lolimi.cn/API/wydg/api.php?msg={}&n
|
|||||||
*/
|
*/
|
||||||
export const QQ_MUSIC_TEMP_API = "https://api.lolimi.cn/API/yiny/?word={}&n=1&q=8"
|
export const QQ_MUSIC_TEMP_API = "https://api.lolimi.cn/API/yiny/?word={}&n=1&q=8"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载VIP的临时接口3
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
export const QISHUI_MUSIC_TEMP_API = "https://api.cenguigui.cn/api/qishui/?msg={}&limit=1&type=json&n=1"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单条微博的接口
|
* 单条微博的接口
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user