Changed default cacheDuration, it matches variable

This commit is contained in:
Violet 2023-10-23 22:39:30 -05:00
parent 675c55bb1b
commit 8dd4dce08b

View file

@ -25,7 +25,7 @@ function formatBytes(bytes, decimals = 2) {
fs.mkdirSync(path.join(__dirname, 'cached')) fs.mkdirSync(path.join(__dirname, 'cached'))
const cacheDuration = 15 || process.env.CACHEDUR const cacheDuration = 30 || process.env.CACHEDUR
process.on('uncaughtException', (err, origin) => { process.on('uncaughtException', (err, origin) => {
fs.writeSync( fs.writeSync(
@ -98,7 +98,7 @@ app.get("/getLink", async (req, res) => {
} }
</style> </style>
`) `)
res.write(`<p><a href="/download?path=${path.basename(file)}&filename=${filename}.${format}" target="_blank">Link to video download!</a> (Link is deleted after 15 minutes!)</p>`) res.write(`<p><a href="/download?path=${path.basename(file)}&filename=${filename}.${format}" target="_blank">Link to video download!</a> (Link is deleted after ${cacheDuration} minutes!)</p>`)
setTimeout(()=>{ setTimeout(()=>{
if (fs.existsSync(ytpath)) { if (fs.existsSync(ytpath)) {
fs.unlinkSync(ytpath) fs.unlinkSync(ytpath)