diff --git a/README.md b/README.md index 274e529..ac9a1ec 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ YouTube解析参考了:[yt-dlp:A youtube-dl fork with additional features and | 昵称 | 赞助 | |:---------------:|------| -| 为爱发巅 | 1杯瑞幸 | +| 为爱发巅 | 1杯瑞幸 | | 丘丘莹 | 5 | | Allweknow | 1杯瑞幸 | | MNJv | 5 | @@ -175,6 +175,7 @@ YouTube解析参考了:[yt-dlp:A youtube-dl fork with additional features and | 左轮(ps. 我导师,泪目!) | 1杯瑞幸 | | mitsuha | 1杯瑞幸 | | [Kr] 5s¹ | 1杯瑞幸 | +| 春日野穹OvO | 25 | ## 🚀 声明 * 文件借鉴了很多插件,精简个人认为可以精简的内容。 diff --git a/apps/tools.js b/apps/tools.js index 39bf918..fdd6f26 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -988,15 +988,18 @@ export class tools extends plugin { // 下载地址格式化 const path = `${ v }${ p ? `/p${ p }` : '' }`; const fullpath = `${ this.defaultPath }${ this.e.group_id || this.e.user_id }/${ path }`; + // 创建下载文件夹 + await mkdirIfNotExists(fullpath); // yt-dlp下载 let cmd = //`cd '${__dirname}' && (cd tmp > /dev/null || (mkdir tmp && cd tmp)) &&` + - `yt-dlp ${ this.y2bCk !== undefined ? `--cookies ${ this.y2bCk }` : '' } https://youtu.be/${ v } -f ${ format.replace('x', '+') } ` + + `yt-dlp ${ this.y2bCk !== undefined ? `--cookies ${ this.y2bCk }` : '' } ${url} -f ${ format.replace('x', '+') } ` + `-o '${ fullpath }/${ v }.%(ext)s' ${ isProxy ? `--proxy ${ this.proxyAddr }:${ this.proxyPort }` : '' } -k --write-info-json`; + logger.info(cmd) try { await child_process.execSync(cmd); e.reply(segment.video(`${ fullpath }/${ v }.mp4`)) // 清理文件 - await deleteFolderRecursive(fullpath); + // await deleteFolderRecursive(`${ fullpath.split('\/').slice(0, -2).join('/') }`); } catch (error) { logger.error(error.toString()); e.reply("y2b下载失败");