From a69a022bd4639125ae569c2bc069561d4d28d0c3 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Mon, 19 Aug 2024 21:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E5=A2=9E=E5=8A=A0=E7=9F=AD?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 22b320f..7cab1a5 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -519,11 +519,6 @@ export class tools extends plugin { ]); return true; } - // 处理番剧 - if (url.includes("play\/ep") || url.includes("play\/ss")) { - await this.biliEpInfo(url, e); - return true - } // 处理专栏 if (e.msg !== undefined && e.msg.includes("read\/cv")) { this.linkShareSummary(e); @@ -538,6 +533,22 @@ export class tools extends plugin { url = this.biliDynamic(e, url, this.biliSessData); return true; } + // 创建文件,如果不存在, + const path = `${ this.getCurDownloadPath(e) }/`; + await mkdirIfNotExists(path); + // 处理番剧 + if (url.includes("play\/ep") || url.includes("play\/ss")) { + const ep = await this.biliEpInfo(url, e); + // 如果使用了BBDown && 没有填写session 就放开下载 + if (this.biliUseBBDown === true && _.isEmpty(this.biliSessData)) { + // 加入队列 + this.queue.add(async () => { + // 下载文件 + await this.biliDownloadStrategy(e, `https://www.bilibili.com/bangumi/play/ep${ ep }`, path); + }) + } + return true; + } // 视频信息获取例子:http://api.bilibili.com/x/web-interface/view?bvid=BV1hY411m7cB // 请求视频信息 const videoInfo = await getVideoInfo(url); @@ -601,10 +612,6 @@ export class tools extends plugin { e.reply(`${ this.identifyPrefix } 识别:哔哩哔哩音乐,正在提取请稍候...`) return await this.biliMusic(e, url); } - - // 创建文件,如果不存在 - const path = `${ this.getCurDownloadPath(e) }/`; - await mkdirIfNotExists(path); // 加入队列 this.queue.add(async () => { // 下载文件 @@ -653,6 +660,7 @@ export class tools extends plugin { `${ formatBiliInfo(dataProcessMap) }`, `\n\n在线观看: ${ await urlTransformShortLink(ANIME_SERIES_SEARCH_LINK + result.title) }` ], true); + return ep; } /**