From 9e9a307f7c42c4e3867415472090d3d358b4c824 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Wed, 16 Nov 2022 21:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=A0=81=E8=AE=BE=E7=BD=AE=E4=B8=BA`1`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/Program.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/N_m3u8DL-RE/Program.cs b/src/N_m3u8DL-RE/Program.cs index d6a8866..9d89bee 100644 --- a/src/N_m3u8DL-RE/Program.cs +++ b/src/N_m3u8DL-RE/Program.cs @@ -322,24 +322,27 @@ namespace N_m3u8DL_RE Headers = parserConfig.Headers, //使用命令行解析得到的Headers }; + var result = false; if (!livingFlag) { //开始下载 var sdm = new SimpleDownloadManager(downloadConfig); - var result = await sdm.StartDownloadAsync(selectedStreams); - if (result) - Logger.InfoMarkUp("[white on green]Done[/]"); - else - Logger.ErrorMarkUp("[white on red]Failed[/]"); + result = await sdm.StartDownloadAsync(selectedStreams); } else { var sldm = new SimpleLiveRecordManager2(downloadConfig, selectedStreams, extractor); - var result = await sldm.StartRecordAsync(); - if (result) - Logger.InfoMarkUp("[white on green]Done[/]"); - else - Logger.ErrorMarkUp("[white on red]Failed[/]"); + result = await sldm.StartRecordAsync(); + } + + if (result) + { + Logger.InfoMarkUp("[white on green]Done[/]"); + } + else + { + Logger.ErrorMarkUp("[white on red]Failed[/]"); + Environment.ExitCode = 1; } }