No longer downloads video for audio formats
This commit is contained in:
parent
e301dfc604
commit
9a6cf946a6
1 changed files with 5 additions and 1 deletions
6
index.js
6
index.js
|
@ -101,7 +101,11 @@ app.get("/getLink", async (req, res) => {
|
|||
res.write(`<p>Starting download...</p>`)
|
||||
}
|
||||
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) => {
|
||||
|
|
Loading…
Reference in a new issue