1
0
forked from Tomas/webdl

Don't redownload urls

This commit is contained in:
2026-01-09 04:01:25 +01:00
parent 79c238b912
commit 2d8b1485a0

View File

@ -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);