diff --git a/src/index.ts b/src/index.ts index 6c926ac..b69cf48 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,6 +38,14 @@ app.get("/download/:filename", (req,res)=>{ parts.shift(); const url = parts.join("?"); + for (const dl of Object.entries(dlmgr.getDownloads())) + if (dl[1].url == url) + return res.status(303).header("Location", "/#"+dl[0]).send(dl[0]); + + for (const dl of Object.entries(dlmgr.getQueue())) + if (dl[1].url == url) + return res.status(303).header("Location", "/#"+dl[0]).send(dl[0]); + const id = dlmgr.download(url, filename); return res.status(303).header("Location", "/#"+id).send(id);