From 623d85f88bb42834b335801ad5d703f6945d38d2 Mon Sep 17 00:00:00 2001 From: RblSb Date: Mon, 19 May 2025 03:06:41 +0300 Subject: Migrate to yt-dlp - yt-dlp should be more stable and allows more cool stuff in future - easier to export cookies.txt with yt-dlp utility (cookies.json support removed) - better quality fallback if not enough space - keep progress reports after reconnections --- src/server/Main.hx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/server/Main.hx') diff --git a/src/server/Main.hx b/src/server/Main.hx index 8164922..3cde049 100644 --- a/src/server/Main.hx +++ b/src/server/Main.hx @@ -58,7 +58,9 @@ class Main { public final clients:Array = []; final freeIds:Array = []; + #if !display final wsEventParser = new JsonParser(); + #end final consoleInput:ConsoleInput; final cache:Cache; final cacheDir:String; @@ -960,6 +962,7 @@ class Main { serverMessage(client, "Free space: " + (cache.getFreeSpace() / 1024).toFixed() + "KiB"); + serverMessage(client, "Memory usage: " + js.Node.process.memoryUsage()); send(client, { type: Dump, dump: { @@ -1006,6 +1009,11 @@ class Main { client.ws.send(jsonStringify(data), null); } + public function sendByName(clientName:String, data:WsEvent):Void { + final client = clients.getByName(clientName) ?? return; + client.ws.send(jsonStringify(data), null); + } + public function broadcast(data:WsEvent):Void { final json = jsonStringify(data); for (client in clients) -- cgit v1.2.3