oops
This commit is contained in:
parent
f9da622fbf
commit
72defd0e69
1 changed files with 4 additions and 1 deletions
5
index.js
5
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 })
|
var audio = ytdl(url, { filter: 'audioonly', quality: quality })
|
||||||
|
|
||||||
|
res.setHeader('Content-Disposition', `attachment; filename="${filename}.${formats[format] || format}"`);
|
||||||
|
|
||||||
audio.pipe(res)
|
audio.pipe(res)
|
||||||
|
|
||||||
} else if (defin == "hd") {
|
} else if (defin == "hd") {
|
||||||
|
|
Loading…
Reference in a new issue