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()));