From 72defd0e69ff8863fe18ed26d81d00ac62a00dfd Mon Sep 17 00:00:00 2001 From: Bingus_Violet Date: Mon, 20 Nov 2023 14:41:17 -0600 Subject: [PATCH] oops --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8ce5bf7..35dd228 100644 --- a/index.js +++ b/index.js @@ -53,8 +53,11 @@ app.get("/download", async (req, res) => { } } - if (format in ["mp3", "ogg", "wav"]) { + if ("mp3 ogg wav".includes(format)) { var audio = ytdl(url, { filter: 'audioonly', quality: quality }) + + res.setHeader('Content-Disposition', `attachment; filename="${filename}.${formats[format] || format}"`); + audio.pipe(res) } else if (defin == "hd") {