adding bypass to the file size limit

This commit is contained in:
localhost 2025-02-02 10:08:51 +01:00
parent dade8017f2
commit 04785be90e
2 changed files with 3 additions and 1 deletions

View File

@ -138,7 +138,8 @@ app.ws('/download/:id/:quality', async (ws, req) => {
const videoWriteStream = fs.createWriteStream(`./output/${req.params.id}_video.mp4`)
let videoTotal = videoFormat.content_length;
if (videoTotal > (1_048_576 * 150)) {
const whitelistedVideos = JSON.parse(fs.readFileSync('./whitelist.json'))
if (videoTotal > (1_048_576 * 150) && !whitelistedVideos.includes(req.params.id)) {
ws.send('Is this content considered high risk? If so, please email me at admin@preservetube.com.');
ws.send('This video is too large, and unfortunately, Preservetube does not have unlimited storage.');
return ws.close()

1
whitelist.json Normal file
View File

@ -0,0 +1 @@
[]