Fix UserAgent

This commit is contained in:
FullGreaM 2025-11-04 02:15:42 +03:00
parent e38c99709d
commit 3886428438

View File

@ -157,7 +157,11 @@ class DownloadVideo {
} }
const result = await new Promise((resolve, reject) => { 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 = ""; let data = "";
@ -212,7 +216,11 @@ class DownloadVideo {
} }
const result = await new Promise((resolve, reject) => { 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 = ""; let data = "";
child.stdout.on("data", (chunk) => (data += chunk.toString())); child.stdout.on("data", (chunk) => (data += chunk.toString()));