From 04785be90e2c87c49dfb681a0b31a80123e7fe57 Mon Sep 17 00:00:00 2001 From: localhost Date: Sun, 2 Feb 2025 10:08:51 +0100 Subject: [PATCH] adding bypass to the file size limit --- index.js | 3 ++- whitelist.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 whitelist.json diff --git a/index.js b/index.js index 8e9f239..4b8692a 100644 --- a/index.js +++ b/index.js @@ -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() diff --git a/whitelist.json b/whitelist.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/whitelist.json @@ -0,0 +1 @@ +[] \ No newline at end of file