Redirect after download

This commit is contained in:
Bingus_Violet 2024-01-18 18:09:13 -06:00
parent d8f867745d
commit 1cb26a7f99
2 changed files with 2 additions and 2 deletions

View file

@ -125,7 +125,7 @@ app.get("/download", async (req, res) => {
}
else if (fs.existsSync(filePath)) {
res.write(`<iframe src="/convert?file=${fileName}&format=${format}&url=${url}"></iframe>"`)
res.write(downloadHTML.substring(downloadHTML.indexOf("{CONTENT}") + 9), () => { res.end() })
res.write(downloadHTML.substring(downloadHTML.indexOf("{CONTENT}") + 9) + `<meta http-equiv="Refresh" content="0; url='/'" />`, () => { res.end() })
} else {
res.write("<p>An error has occured!!! We're not exactly sure what the error is, but we cant seem to find the download file. Double check the URL, and if the URL is fine, then file an issue on codeberg. </p>")
}

View file

@ -17,7 +17,7 @@
<hr>
</h1>
<form action="/download" method="get" target="_blank">
<form action="/download" method="get">
<p style="margin-bottom: 1px;">Video URL:</p>
<input required type="url" id="url" placeholder="Enter url" name="url" style="width: 80vw; max-width: 550px">