diff --git a/src/N_m3u8DL-RE/Program.cs b/src/N_m3u8DL-RE/Program.cs index 0cb4994..b5432d3 100644 --- a/src/N_m3u8DL-RE/Program.cs +++ b/src/N_m3u8DL-RE/Program.cs @@ -21,6 +21,7 @@ namespace N_m3u8DL_RE { static async Task Main(string[] args) { + Console.CancelKeyPress += Console_CancelKeyPress; ServicePointManager.DefaultConnectionLimit = 1024; try { Console.CursorVisible = true; } catch { } string loc = "en-US"; @@ -44,6 +45,13 @@ namespace N_m3u8DL_RE await CommandInvoker.InvokeArgs(args, DoWorkAsync); } + private static void Console_CancelKeyPress(object? sender, ConsoleCancelEventArgs e) + { + Logger.WarnMarkUp("Force Exit..."); + try { Console.CursorVisible = true; } catch { } + Environment.Exit(0); + } + static int GetOrder(StreamSpec streamSpec) { if (streamSpec.Channels == null) return 0;