diff --git a/index.js b/index.js index 18681ae..5fe3a30 100644 --- a/index.js +++ b/index.js @@ -101,7 +101,11 @@ app.get("/getLink", async (req, res) => { res.write(`

Starting download...

`) } var lastp = 0 - var ytvid = ytdl(url, { 'quality': quality, 'format': 'mp4' }) + if ("mp3 ogg wav".includes(format)) { + var ytvid = ytdl(url, { 'quality': quality, 'format': 'mp4', filter: "audioonly" }) + } else { + var ytvid = ytdl(url, { 'quality': quality, 'format': 'mp4', filter: "videoandaudio" }) + } if (redir != "redirect") { ytvid.on("progress", (data, ctotal, etotal) => {