From 072987e1095da246eb92ef519d7160149b23e022 Mon Sep 17 00:00:00 2001 From: Violet Date: Sat, 28 Oct 2023 22:46:49 -0500 Subject: [PATCH] Fixed mobile, Fixed no audio? --- index.js | 7 ++++--- static/index.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 5fe3a30..9714372 100644 --- a/index.js +++ b/index.js @@ -68,14 +68,15 @@ app.get("/getLink", async (req, res) => { } if (["mp4", "webm"].includes(format)) { - var ytvid = ytdl(url, { 'quality': quality, 'format': format }) + var ytvid = ytdl(url, { 'quality': quality, 'format': format, 'filter': 'videoandaudio' }) var debounce = false ytvid.on("progress", (chunk, cd, td) => { if (!debounce) { - res.setHeader('Content-Disposition', `attachment; filename="${filename}.${format}";`); + res.setHeader('Content-Disposition', `attachment; filename="${filename}.${format}";`) + res.setHeader('Content-Type', `video/${format}`) + console.log(`${filename}.${format}"`) res.setHeader("Content-Length", td) ytvid.pipe(res) - // console.log(td) debounce = true } }) diff --git a/static/index.html b/static/index.html index 57d0b48..0e64264 100644 --- a/static/index.html +++ b/static/index.html @@ -55,7 +55,7 @@