Fix passing cookies
This commit is contained in:
parent
4ccc75d38b
commit
25fa65e171
|
@ -109,7 +109,7 @@ module.exports = {
|
||||||
} else {
|
} else {
|
||||||
tempFilePath = path.join(__dirname, '../utils/tmp', `${uuidv4()}.mp3`);
|
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) {
|
if (error) {
|
||||||
console.error(`Error getting title: ${error}`);
|
console.error(`Error getting title: ${error}`);
|
||||||
message.reply('Failed to retrieve video title.');
|
message.reply('Failed to retrieve video title.');
|
||||||
|
@ -141,7 +141,7 @@ module.exports = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
if (error) {
|
||||||
console.error(`Error searching: ${error}`);
|
console.error(`Error searching: ${error}`);
|
||||||
message.reply('Failed to search for video.');
|
message.reply('Failed to search for video.');
|
||||||
|
|
Loading…
Reference in New Issue