update 29

This commit is contained in:
2021-11-29 18:43:56 +01:00
parent dee9316f9b
commit 8812593f38
5 changed files with 132 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ const { createServer } = require('http');
const cors = require('@koa/cors');
const logger = require('./lib/logger');
const { download, abortDownload } = require('./lib/downloader');
const { ytdlpUpdater } = require('./lib/updater');
const app = new Koa()
const server = createServer(app.callback())
@@ -23,10 +24,13 @@ io.on('connection', socket => {
logger('ws', args)
download(socket, args)
})
socket.on('abort', () => {
abortDownload(socket)
})
socket.on('update-bin', () => {
ytdlpUpdater(socket)
})
})
io.on('disconnect', () => {