From 990ae6d8ece260e58b5a9bbbc911dedd4dc5777d Mon Sep 17 00:00:00 2001 From: localhost Date: Sat, 30 Sep 2023 17:32:52 +0200 Subject: [PATCH] ignoring alive messages --- controller/websocket.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controller/websocket.js b/controller/websocket.js index 6d8fa23..927fb33 100644 --- a/controller/websocket.js +++ b/controller/websocket.js @@ -43,6 +43,8 @@ exports.save = async (ws, req) => { ws.send('CAPTCHA - Please complete the captcha:') ws.on('message', async function(msg) { + if (msg == 'alive') return + if (await redis.get(id) != 'downloading') { await redis.set(id, 'downloading') const confirm = await captcha.checkCaptcha(msg) @@ -99,6 +101,8 @@ exports.playlist = async (ws, req) => { ws.send('CAPTCHA - Please complete the captcha:') ws.on('message', async function(msg) { + if (msg == 'alive') return + if (status == 'captcha') { status = 'downloading' const confirm = await captcha.checkCaptcha(msg) @@ -203,6 +207,8 @@ exports.channel = async (ws, req) => { ws.send('CAPTCHA - Please complete the captcha:') ws.on('message', async function(msg) { + if (msg == 'alive') return + if (status == 'captcha') { status = 'downloading' const confirm = await captcha.checkCaptcha(msg)