diff --git a/README.md b/README.md index 2934774..80b2a2b 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,8 @@ chmod a+rx ~/.local/bin/yt-dlp # debian 国内 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 +# archlinux +sudo pacman -Syu yt-dlp ``` 4. 【可选】小程序解析适配了: @@ -151,8 +153,7 @@ git clone -b 1.5.1 https://gitee.com/kyrzy0416/rconsole-plugin.git `proxyPort: '7890' # 魔法端口` > 海外服务器示例: -`proxyAddr: '127.0.0.1' # 魔法地址` -`proxyPort: '80' # 魔法端口` +直接发送`#设置海外解析` ## 📦 业务 diff --git a/apps/tools.js b/apps/tools.js index e01a2d4..2c272c9 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -136,7 +136,7 @@ export class tools extends plugin { fnc: "general", }, { - reg: "(youtube.com|youtu.be)", + reg: "(youtube.com|youtu.be|music.youtube.com)", fnc: "sy2b" }, { @@ -1173,10 +1173,15 @@ export class tools extends plugin { return false; } 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; 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") const title = execSync(`yt-dlp --get-title ${ url } ${ isOversea ? "" : `--proxy ${ this.myProxy }` }`) e.reply(`识别:油管,视频下载中请耐心等待 \n${ title }`);