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.');