From 3886428438a88ab37723743ef1fd21dc0234ea1a Mon Sep 17 00:00:00 2001 From: FullGreaM Date: Tue, 4 Nov 2025 02:15:42 +0300 Subject: [PATCH] Fix UserAgent --- src/download.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/download.js b/src/download.js index d700cd6..fdf6cd9 100644 --- a/src/download.js +++ b/src/download.js @@ -157,7 +157,11 @@ class DownloadVideo { } const result = await new Promise((resolve, reject) => { - const child = spawn("yt-dlp", ["--cookies", "cookies.txt", "-j", this.url]); + const child = spawn("yt-dlp", [ + "--cookies", "cookies.txt", + "--user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", + "-j", this.url + ]); let data = ""; @@ -212,7 +216,11 @@ class DownloadVideo { } const result = await new Promise((resolve, reject) => { - const child = spawn("yt-dlp", ["--cookies", "cookies.txt", "-j", this.url]); + const child = spawn("yt-dlp", [ + "--cookies", "cookies.txt", + "--user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", + "-j", this.url + ]); let data = ""; child.stdout.on("data", (chunk) => (data += chunk.toString()));