ignoring alive messages

This commit is contained in:
localhost 2023-09-30 17:32:52 +02:00
parent 8bdc0738f9
commit 990ae6d8ec
1 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,8 @@ exports.save = async (ws, req) => {
ws.send('CAPTCHA - Please complete the captcha:') ws.send('CAPTCHA - Please complete the captcha:')
ws.on('message', async function(msg) { ws.on('message', async function(msg) {
if (msg == 'alive') return
if (await redis.get(id) != 'downloading') { if (await redis.get(id) != 'downloading') {
await redis.set(id, 'downloading') await redis.set(id, 'downloading')
const confirm = await captcha.checkCaptcha(msg) const confirm = await captcha.checkCaptcha(msg)
@ -99,6 +101,8 @@ exports.playlist = async (ws, req) => {
ws.send('CAPTCHA - Please complete the captcha:') ws.send('CAPTCHA - Please complete the captcha:')
ws.on('message', async function(msg) { ws.on('message', async function(msg) {
if (msg == 'alive') return
if (status == 'captcha') { if (status == 'captcha') {
status = 'downloading' status = 'downloading'
const confirm = await captcha.checkCaptcha(msg) const confirm = await captcha.checkCaptcha(msg)
@ -203,6 +207,8 @@ exports.channel = async (ws, req) => {
ws.send('CAPTCHA - Please complete the captcha:') ws.send('CAPTCHA - Please complete the captcha:')
ws.on('message', async function(msg) { ws.on('message', async function(msg) {
if (msg == 'alive') return
if (status == 'captcha') { if (status == 'captcha') {
status = 'downloading' status = 'downloading'
const confirm = await captcha.checkCaptcha(msg) const confirm = await captcha.checkCaptcha(msg)