Open bek-shoyatbek opened 1 year ago
const { dlAudioVideo } = require("youtube-exec");
// Using Promises
dlAudioVideo({
url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
folder: "./assets/temp", // optional, default: "youtube-exec"
filename: "filename", // optional, default: video title
resolution: 144, // 144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320; default: 480
})
.then(() => {
audioPath =("./assets/temp/filename.mp4");
console.log("Video downloaded successfully! 🎥🔊🎉");
// if (fs.existsSync("./assets/temp/filename.mp4")) {
// fs.unlinkSync("./assets/temp/filename.mp4");
// }
})
.catch((err) => {
console.error("An error occurred:", err.message);
});
I want to use it but I couldn't find any examples... It would be great if you add it...