mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ feat: V1.6.7 适配 YouTube Music
This commit is contained in:
parent
49f765e082
commit
c2c75fccc0
@ -75,6 +75,8 @@ chmod a+rx ~/.local/bin/yt-dlp
|
|||||||
# debian 国内
|
# debian 国内
|
||||||
curl -L https://ghproxy.net/https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp
|
curl -L https://ghproxy.net/https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp
|
||||||
chmod a+rx ~/.local/bin/yt-dlp
|
chmod a+rx ~/.local/bin/yt-dlp
|
||||||
|
# archlinux
|
||||||
|
sudo pacman -Syu yt-dlp
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 【可选】小程序解析适配了:
|
4. 【可选】小程序解析适配了:
|
||||||
@ -151,8 +153,7 @@ git clone -b 1.5.1 https://gitee.com/kyrzy0416/rconsole-plugin.git
|
|||||||
`proxyPort: '7890' # 魔法端口`
|
`proxyPort: '7890' # 魔法端口`
|
||||||
|
|
||||||
> 海外服务器示例:
|
> 海外服务器示例:
|
||||||
`proxyAddr: '127.0.0.1' # 魔法地址`
|
直接发送`#设置海外解析`
|
||||||
`proxyPort: '80' # 魔法端口`
|
|
||||||
|
|
||||||
|
|
||||||
## 📦 业务
|
## 📦 业务
|
||||||
|
@ -136,7 +136,7 @@ export class tools extends plugin {
|
|||||||
fnc: "general",
|
fnc: "general",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: "(youtube.com|youtu.be)",
|
reg: "(youtube.com|youtu.be|music.youtube.com)",
|
||||||
fnc: "sy2b"
|
fnc: "sy2b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1173,10 +1173,15 @@ export class tools extends plugin {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const urlRex = /(?:https?:\/\/)?(www\.)?youtube\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const urlRex = /(?:https?:\/\/)?(www\.|music\.)?youtube\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
const url2Rex = /(?:https?:\/\/)?youtu\.be\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const url2Rex = /(?:https?:\/\/)?youtu\.be\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
let url = urlRex.exec(e.msg)?.[0] || url2Rex.exec(e.msg)?.[0];
|
let url = urlRex.exec(e.msg)?.[0] || url2Rex.exec(e.msg)?.[0];
|
||||||
const path = this.getCurDownloadPath(e)
|
// 适配 YouTube Music
|
||||||
|
if (url.includes("music")) {
|
||||||
|
// https://music.youtube.com/watch?v=F4sRtMoIgUs&si=7ZYrHjlI3fHAha0F
|
||||||
|
url = url.replace("music", "www");
|
||||||
|
}
|
||||||
|
const path = this.getCurDownloadPath(e);
|
||||||
await checkAndRemoveFile(path + "/temp.mp4")
|
await checkAndRemoveFile(path + "/temp.mp4")
|
||||||
const title = execSync(`yt-dlp --get-title ${ url } ${ isOversea ? "" : `--proxy ${ this.myProxy }` }`)
|
const title = execSync(`yt-dlp --get-title ${ url } ${ isOversea ? "" : `--proxy ${ this.myProxy }` }`)
|
||||||
e.reply(`识别:油管,视频下载中请耐心等待 \n${ title }`);
|
e.reply(`识别:油管,视频下载中请耐心等待 \n${ title }`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user