diff --git a/apps/tools.js b/apps/tools.js index ffe2e26..3ee887d 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1369,7 +1369,7 @@ export class tools extends plugin { await checkAndRemoveFile(path + "/temp.mp4") const title = execSync(`yt-dlp --get-title ${ url } ${ isOversea ? "" : `--proxy ${ this.myProxy }` }`) e.reply(`识别:油管,视频下载中请耐心等待 \n${ title }`); - await dy2b(path, url, isOversea); + await dy2b(path, url, isOversea, this.myProxy); this.sendVideoToUpload(e, `${ path }/temp.mp4`); } catch (error) { console.error(error); diff --git a/utils/yt-dlp-util.js b/utils/yt-dlp-util.js index cc2a748..585ff25 100644 --- a/utils/yt-dlp-util.js +++ b/utils/yt-dlp-util.js @@ -5,9 +5,9 @@ * @param url 下载链接 * @param isOversea 是否是海外用户 */ -export async function dy2b(path, url, isOversea) { +export async function dy2b(path, url, isOversea, proxy) { return new Promise((resolve, reject) => { - const command = `yt-dlp ${ isOversea ? "" : `--proxy ${ this.myProxy }` } -P ${ path } -o "temp.%(ext)s" --merge-output-format "mp4" ${ url }`; + const command = `yt-dlp ${ isOversea ? "" : `--proxy ${ proxy }` } -P ${ path } -o "temp.%(ext)s" --merge-output-format "mp4" ${ url }`; exec(command, (error, stdout) => { if (error) { console.error(`Error executing command: ${ error }`);