mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
✨ feat: 新增波点音乐点mv
This commit is contained in:
parent
44216cf71d
commit
d601617268
@ -31,16 +31,16 @@ export class neteasepro extends plugin {
|
||||
rule: [
|
||||
{
|
||||
/** 命令正则匹配 */
|
||||
reg: "#网易云登录",
|
||||
reg: "^#网易云登录$",
|
||||
/** 执行方法 */
|
||||
fnc: "neteaseCloudLogin",
|
||||
},
|
||||
{
|
||||
reg: "#网易云每日推荐",
|
||||
reg: "^#网易云每日推荐$",
|
||||
fnc: "neteaseDailyRecommend",
|
||||
},
|
||||
{
|
||||
reg: "#网易云听歌排行",
|
||||
reg: "^#网易云听歌排行$",
|
||||
fnc: "neteaseListenRank",
|
||||
},
|
||||
{
|
||||
|
@ -33,11 +33,11 @@ export class query extends plugin {
|
||||
fnc: "cat",
|
||||
},
|
||||
{
|
||||
reg: "^#电脑软件推荐$" /** 执行方法 */,
|
||||
reg: "^#电脑软件推荐$",
|
||||
fnc: "computerRecommended",
|
||||
},
|
||||
{
|
||||
reg: "^#安卓软件推荐$" /** 执行方法 */,
|
||||
reg: "^#安卓软件推荐$",
|
||||
fnc: "androidRecommended",
|
||||
},
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 主库
|
||||
import fetch from "node-fetch";
|
||||
import fs from "node:fs";
|
||||
import { Gfs, segment } from "oicq";
|
||||
import { segment } from "oicq";
|
||||
// 其他库
|
||||
import md5 from "md5";
|
||||
import axios from "axios";
|
||||
@ -65,6 +65,10 @@ export class tools extends plugin {
|
||||
fnc: "clearTrash",
|
||||
permission: "master",
|
||||
},
|
||||
{
|
||||
reg: '^#波点音乐(.*)',
|
||||
fnc: 'bodianMusic'
|
||||
}
|
||||
],
|
||||
});
|
||||
// http://api.tuwei.space/girl
|
||||
@ -638,6 +642,48 @@ export class tools extends plugin {
|
||||
}
|
||||
}
|
||||
|
||||
async bodianMusic(e) {
|
||||
const msg = e.msg.replace("#波点音乐").trim()
|
||||
const API = `https://xiaobai.klizi.cn/API/music/bodian.php?msg=${msg}&n=&max=`
|
||||
// 获取列表
|
||||
const thisMethod = this;
|
||||
await axios.get(API).then(resp => {
|
||||
/**
|
||||
* "songName": "山海",
|
||||
* "artist": "草东没有派对",
|
||||
* "coverUrl": "https://img3.kuwo.cn/wmvpic/324/78/55/3196258119.jpg",
|
||||
* "highUrl": "http://other.player.nf03.sycdn.kuwo.cn/f7451ba7f02256b6b5d5ae8a74336502/64172260/resource/m2/55/56/3401786858.mp4?from=bodian",
|
||||
* "lowUrl": "http://other.player.nf03.sycdn.kuwo.cn/47e753a5f8350140716e439f1c87dc1f/64172260/resource/m3/50/96/2318372432.mp4?from=bodian",
|
||||
* "shortLowUrl": null
|
||||
*/
|
||||
e.reply("请选择一个要播放的视频:\n" + resp.data);
|
||||
thisMethod.setContext("bodianMusicContext");
|
||||
})
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @link bodianMusic 波点音乐上下文
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async bodianMusicContext() {
|
||||
// 当前消息
|
||||
const curMsg = this.e;
|
||||
// 上一个消息
|
||||
const preMsg = await this.getContext().bodianMusicContext;
|
||||
const msg = preMsg.msg.replace("#波点音乐", "").trim();
|
||||
const API = `https://xiaobai.klizi.cn/API/music/bodian.php?msg=${msg}&n=${Number(curMsg.msg)}&max=`
|
||||
const thisMethod = this;
|
||||
await axios.get(API).then(async res => {
|
||||
const {songName, artist, coverUrl, highUrl, lowUrl, shortLowUrl} = res.data;
|
||||
curMsg.reply([`${songName}-${artist}\n`, segment.image(coverUrl)]);
|
||||
await thisMethod.downloadVideo(lowUrl).then(path => {
|
||||
curMsg.reply(segment.video(path + "/temp.mp4"));
|
||||
})
|
||||
thisMethod.finish("bodianMusicContext");
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 哔哩哔哩下载
|
||||
* @param title
|
||||
@ -791,7 +837,7 @@ export class tools extends plugin {
|
||||
res.data.pipe(writer);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
writer.on("finish", resolve);
|
||||
writer.on("finish", () => resolve(groupPath));
|
||||
writer.on("error", reject);
|
||||
});
|
||||
}
|
||||
|
@ -56,6 +56,9 @@
|
||||
- icon: netease
|
||||
title: "网易云音乐"
|
||||
desc: 网易云音乐解析
|
||||
- icon: bodian
|
||||
title: "#波点音乐"
|
||||
desc: 波点云音乐点MV
|
||||
- group: 其他指令
|
||||
list:
|
||||
- icon: update
|
||||
|
@ -2,6 +2,7 @@
|
||||
version: 1.1.0-rc0,
|
||||
data:
|
||||
[
|
||||
新增<span class="cmd">#波点音乐</span>MV点歌,
|
||||
升级<span class="cmd">netease解析</span>全面重构!,
|
||||
适配<span class="cmd">bilibili小程序解析</span>,
|
||||
增加<span class="cmd">#搜书</span>查询,
|
||||
|
BIN
resources/img/icon/bodian.png
Normal file
BIN
resources/img/icon/bodian.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
x
Reference in New Issue
Block a user