From fbce4bf46ee7165253ed3bc27900a5cf71eda34e Mon Sep 17 00:00:00 2001 From: "DESKTOP-I4SRUE6\\NikoYoke" Date: Thu, 17 Oct 2024 22:38:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8E=88pref=EF=BC=9A=E5=A4=9A=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E4=B8=8B=E8=BD=BD=E6=94=AF=E6=8C=81tiktok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 4 ++-- guoba.support.js | 2 +- utils/yt-dlp-util.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index dce622b..0f966fb 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -620,7 +620,7 @@ export class tools extends plugin { await checkAndRemoveFile(path + "/temp.mp4"); const title = ytDlpGetTilt(url, isOversea, this.myProxy); e.reply(`${ this.identifyPrefix }识别:TikTok,视频下载中请耐心等待 \n${ title }`); - await ytDlpHelper(path, cleanedTiktokUrl, isOversea, this.myProxy); + await ytDlpHelper(path, cleanedTiktokUrl, isOversea, this.myProxy, this.videoDownloadConcurrency); await this.sendVideoToUpload(e, `${ path }/temp.mp4`); return true; } @@ -1973,7 +1973,7 @@ export class tools extends plugin { } else { e.reply([segment.image(`${ path }/thumbnail.png`),`${ this.identifyPrefix }识别:油管,视频下载中请耐心等待 \n视频标题:${ title }\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟`]); } - await ytDlpHelper(path, url, isOversea, this.myProxy, true, graphics, timeRange, this.videoDownloadConcurrency); + await ytDlpHelper(path, url, isOversea, this.myProxy, this.videoDownloadConcurrency, true, graphics, timeRange); this.sendVideoToUpload(e, `${ path }/temp.mp4`); } catch (error) { logger.error(error); diff --git a/guoba.support.js b/guoba.support.js index aab6663..600d478 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -330,7 +330,7 @@ export function supportGuoba() { field: "tools.videoDownloadConcurrency", label: "(高级)下载并发个数", bottomHelpMessage: - "【涉及哔哩哔哩、抖音、YouTuBe】下载并发个数:与【允许多用户下载个数】不同,这个功能影响下载速度。默认是1表示不使用,使用根据服务器性能进行选择,如果不确定是否可以用1即可,高性能服务器随意4~12都可以,看CPU的实力", + "【涉及哔哩哔哩、抖音、YouTuBe、tiktok】下载并发个数:与【允许多用户下载个数】不同,这个功能影响下载速度。默认是1表示不使用,使用根据服务器性能进行选择,如果不确定是否可以用1即可,高性能服务器随意4~12都可以,看CPU的实力", component: "InputNumber", required: false, componentProps: { diff --git a/utils/yt-dlp-util.js b/utils/yt-dlp-util.js index ad4e9c2..8a9de88 100644 --- a/utils/yt-dlp-util.js +++ b/utils/yt-dlp-util.js @@ -56,13 +56,13 @@ export function ytDlpGetThumbnail(path, url, isOversea, proxy) { * @param timeRange 截取时间段 * @param maxThreads 最大线程数 */ -export async function ytDlpHelper(path, url, isOversea, proxy, merge = false, graphics, timeRange, maxThreads) { +export async function ytDlpHelper(path, url, isOversea, proxy, maxThreads, merge = false, graphics, timeRange) { return new Promise((resolve, reject) => { const mergeOption = merge ? '--merge-output-format "mp4"' : ''; - const fParam = url.includes("youtu") ? `--download-sections "*${timeRange}" -f "bv${graphics}[ext=mp4]+ba[ext=m4a]" --concurrent-fragments ${maxThreads} ` : ""; + const fParam = url.includes("youtu") ? `--download-sections "*${timeRange}" -f "bv${graphics}[ext=mp4]+ba[ext=m4a]" ` : ""; - const command = `yt-dlp ${fParam} ${constructProxyParam(isOversea, proxy)} -P ${path} -o "temp.%(ext)s" ${url}`; + const command = `yt-dlp ${fParam} --concurrent-fragments ${maxThreads} ${constructProxyParam(isOversea, proxy)} -P ${path} -o "temp.%(ext)s" ${url}`; logger.info(`[R插件][yt-dlp审计] ${command}`) From 598ac9435eb79fd94238447e7a500d329e340b16 Mon Sep 17 00:00:00 2001 From: "DESKTOP-I4SRUE6\\NikoYoke" Date: Thu, 17 Oct 2024 22:40:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=88pref=EF=BC=9A=E5=A4=9A=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E4=B8=8B=E8=BD=BD=E6=94=AF=E6=8C=81tiktok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tools.js b/apps/tools.js index 0f966fb..1198248 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1973,7 +1973,7 @@ export class tools extends plugin { } else { e.reply([segment.image(`${ path }/thumbnail.png`),`${ this.identifyPrefix }识别:油管,视频下载中请耐心等待 \n视频标题:${ title }\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟`]); } - await ytDlpHelper(path, url, isOversea, this.myProxy, this.videoDownloadConcurrency, true, graphics, timeRange); + await ytDlpHelper(path, url, isOversea, this.myProxy, this.videoDownloadConcurrency, true, graphics, timeRange ); this.sendVideoToUpload(e, `${ path }/temp.mp4`); } catch (error) { logger.error(error);