From 125ec1cc93a683f69e9af3d851f6ffb1eefac121 Mon Sep 17 00:00:00 2001 From: ashishpathak2 Date: Mon, 16 Sep 2024 21:51:01 +0530 Subject: [PATCH] new fix --- routes/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/index.js b/routes/index.js index b580b02..8826a07 100644 --- a/routes/index.js +++ b/routes/index.js @@ -71,8 +71,8 @@ router.post('/download', async function (req, res) { const outputFile = path.resolve(tempDir, `${sanitizedTitle}_merged.mp4`); // Download video and audio separately to temp files - const videoStream = ytdl(url, { quality: itag }); - const audioStream = ytdl(url, { quality: 'highestaudio' }); + const videoStream = ytdl(url, { quality: itag , requestOptions: { proxy: 'http://localhost:3000'} }); + const audioStream = ytdl(url, { quality: 'highestaudio' , requestOptions: { proxy: 'http://localhost:3000'}}); // Pipe video and audio to files const videoWriteStream = fs.createWriteStream(videoPath);