From f38442d508ba1f151c7e39ad0449575eed6745c7 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Mon, 19 Aug 2024 22:15:10 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=96=B0=E5=A2=9E=E7=95=AA?= =?UTF-8?q?=E5=89=A7=E8=A7=86=E9=A2=91=E9=99=90=E5=88=B6=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E5=8F=91=E9=80=81=E6=B5=81=E7=95=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 2 +- utils/bbdown-util.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 7cab1a5..ab45f1e 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -540,7 +540,7 @@ export class tools extends plugin { 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)) { + if (this.biliUseBBDown) { // 加入队列 this.queue.add(async () => { // 下载文件 diff --git a/utils/bbdown-util.js b/utils/bbdown-util.js index d3ca211..a5e71b5 100644 --- a/utils/bbdown-util.js +++ b/utils/bbdown-util.js @@ -23,8 +23,13 @@ export function startBBDown(videoUrl, downloadDir, BBDownOptions) { // 这里如果有p参数就放置到url上,没有就相当于作了一次去跟踪参数的清除,也方便BBDown下载 urlObj.search = newParams.toString(); videoUrl = urlObj.toString(); + let pParam = '-M \"temp\" \"-q 720P 高清, 480P 清晰, 360P 流畅\"'; + // 如果不是番剧就常规逻辑 + if (!(videoUrl.includes("play\/ep") || videoUrl.includes("play\/ss"))) { + pParam = pageParam ? '-p ' + pageParam + ' -M \"temp\"' : '-p 1' + ' -M \"temp\"'; + } // 说明:-F 自定义名称,-c 自定义Cookie, --work-dir 设置下载目录,-M 多p下载的时候命名 - const command = `BBDown ${videoUrl} --work-dir ${downloadDir} ${biliSessData ? '-c SESSDATA=' + biliSessData : ''} ${pageParam ? '-p ' + pageParam + ' -M \"temp\"' : '-p 1' + ' -M \"temp\"'} -F temp --skip-subtitle --skip-cover ${biliUseAria2 ? '--use-aria2c' : ''} ${biliCDN ? '--upos-host ' + biliCDN : ''}`; + const command = `BBDown ${videoUrl} --work-dir ${downloadDir} ${biliSessData ? '-c SESSDATA=' + biliSessData : ''} ${pParam} -F temp --skip-subtitle --skip-cover ${biliUseAria2 ? '--use-aria2c' : ''} ${biliCDN ? '--upos-host ' + biliCDN : ''}`; logger.info(command); // logger.info(command); // 直接调用BBDown,因为它已经在系统路径中