From bb9fb6c30e23be3412ab53329d6dc51b57ed0dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=88=80=E9=B1=BC?= <9903082+qdyovo@user.noreply.gitee.com> Date: Fri, 18 Oct 2024 12:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88pref=EF=BC=9A=E4=BC=98=E5=8C=96YouT?= =?UTF-8?q?uBe=E5=8F=8Atiktok=E4=B8=8B=E8=BD=BD=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/tools.yaml | 2 +- utils/yt-dlp-util.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/tools.yaml b/config/tools.yaml index 95487c5..f3f0c8b 100644 --- a/config/tools.yaml +++ b/config/tools.yaml @@ -28,7 +28,7 @@ neteaseCloudAPIServer: '' # 网易云自建服务器地址 neteaseCloudAudioQuality: exhigh # 网易云解析最高音质 默认exhigh(极高) 分类:standard => 标准,higher => 较高, exhigh=>极高, lossless=>无损, hires=>Hi-Res, jyeffect => 高清环绕声, sky => 沉浸环绕声, dolby => 杜比全景声, jymaster => 超清母带 youtubeGraphicsOptions: 720 # YouTobe的下载画质,0为原画,1080,720,480,自定义画面高度(默认为720) -youtubeClipTime: # YouTobe限制的最大视频时长(默认不开启),单位:秒 最好不要超过5分钟,否则截取效率非常低 +youtubeClipTime: 0 # YouTobe限制的最大视频时长(默认不开启),单位:秒 最好不要超过5分钟,否则截取效率非常低 youtubeDuration: 480 # YouTobe限制的最大视频时长(默认8分钟),单位:秒 最好不要超过30分钟,否则截取效率非常低 douyinCookie: '' # douyin's cookie, 格式:odin_tt=xxx;passport_fe_beating_status=xxx;sid_guard=xxx;uid_tt=xxx;uid_tt_ss=xxx;sid_tt=xxx;sessionid=xxx;sessionid_ss=xxx;sid_ucp_v1=xxx;ssid_ucp_v1=xxx;passport_assist_user=xxx;ttwid=xxx; diff --git a/utils/yt-dlp-util.js b/utils/yt-dlp-util.js index 8a9de88..1068ea1 100644 --- a/utils/yt-dlp-util.js +++ b/utils/yt-dlp-util.js @@ -54,7 +54,7 @@ export function ytDlpGetThumbnail(path, url, isOversea, proxy) { * @param merge 是否合并输出为 mp4 格式 (仅适用于视频合并需求) * @param graphics YouTube画质参数 * @param timeRange 截取时间段 - * @param maxThreads 最大线程数 + * @param maxThreads 最大并发 */ export async function ytDlpHelper(path, url, isOversea, proxy, maxThreads, merge = false, graphics, timeRange) { return new Promise((resolve, reject) => { @@ -62,7 +62,7 @@ export async function ytDlpHelper(path, url, isOversea, proxy, maxThreads, merge const fParam = url.includes("youtu") ? `--download-sections "*${timeRange}" -f "bv${graphics}[ext=mp4]+ba[ext=m4a]" ` : ""; - const command = `yt-dlp ${fParam} --concurrent-fragments ${maxThreads} ${constructProxyParam(isOversea, proxy)} -P ${path} -o "temp.%(ext)s" ${url}`; + const command = `yt-dlp -N ${maxThreads} ${fParam} --concurrent-fragments ${maxThreads} ${constructProxyParam(isOversea, proxy)} -P ${path} -o "temp.%(ext)s" ${url}`; logger.info(`[R插件][yt-dlp审计] ${command}`)