From 25fa65e171fe97f12c00283505d1773c93a09235 Mon Sep 17 00:00:00 2001 From: Wizzard Date: Sat, 17 Aug 2024 16:55:41 -0400 Subject: [PATCH] Fix passing cookies --- commands/play.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/play.js b/commands/play.js index 58e594f..0004cbe 100644 --- a/commands/play.js +++ b/commands/play.js @@ -109,7 +109,7 @@ module.exports = { } else { tempFilePath = path.join(__dirname, '../utils/tmp', `${uuidv4()}.mp3`); - exec(`yt-dlp --print title ${searchQuery}`, (error, stdout, stderr) => { + exec(`yt-dlp --cookies ${path.join(__dirname, '../cookies.txt')} --print title ${searchQuery}`, (error, stdout, stderr) => { if (error) { console.error(`Error getting title: ${error}`); message.reply('Failed to retrieve video title.'); @@ -141,7 +141,7 @@ module.exports = { }); } } else { - exec(`yt-dlp --dump-single-json "ytsearch:${searchQuery}"`, (error, stdout, stderr) => { + exec(`yt-dlp --cookies ${path.join(__dirname, '../cookies.txt')} --dump-single-json "ytsearch:${searchQuery}"`, (error, stdout, stderr) => { if (error) { console.error(`Error searching: ${error}`); message.reply('Failed to search for video.');