Fix passing cookies

This commit is contained in:
Wizzard 2024-08-17 16:55:41 -04:00
parent 4ccc75d38b
commit 25fa65e171
1 changed files with 2 additions and 2 deletions

View File

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