diff --git a/src/N_m3u8DL-RE.Parser/StreamExtractor.cs b/src/N_m3u8DL-RE.Parser/StreamExtractor.cs index 8559442..8d0d92d 100644 --- a/src/N_m3u8DL-RE.Parser/StreamExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/StreamExtractor.cs @@ -134,7 +134,7 @@ namespace N_m3u8DL_RE.Parser try { await semaphore.WaitAsync(); - int retryCount = 3; //增加重试 + int retryCount = 5; //增加重试 reGet: try { @@ -145,7 +145,7 @@ namespace N_m3u8DL_RE.Parser if (retryCount-- > 0) { Logger.WarnMarkUp($"[grey]Refresh Exception: {ex.Message.EscapeMarkup()} retryCount: {retryCount}[/]"); - await Task.Delay(300); + await Task.Delay(1000); goto reGet; } else throw; diff --git a/src/N_m3u8DL-RE/Column/RecordingDurationColumn.cs b/src/N_m3u8DL-RE/Column/RecordingDurationColumn.cs index e5af045..cf76384 100644 --- a/src/N_m3u8DL-RE/Column/RecordingDurationColumn.cs +++ b/src/N_m3u8DL-RE/Column/RecordingDurationColumn.cs @@ -14,14 +14,26 @@ namespace N_m3u8DL_RE.Column { protected override bool NoWrap => true; private ConcurrentDictionary _recodingDurDic; - public Style MyStyle { get; set; } = new Style(foreground: Color.Grey); + private ConcurrentDictionary? _refreshedDurDic; + public Style GreyStyle { get; set; } = new Style(foreground: Color.Grey); + public Style MyStyle { get; set; } = new Style(foreground: Color.DarkGreen); public RecordingDurationColumn(ConcurrentDictionary recodingDurDic) { _recodingDurDic = recodingDurDic; } + public RecordingDurationColumn(ConcurrentDictionary recodingDurDic, ConcurrentDictionary refreshedDurDic) + { + _recodingDurDic = recodingDurDic; + _refreshedDurDic = refreshedDurDic; + } public override IRenderable Render(RenderContext context, ProgressTask task, TimeSpan deltaTime) { - return new Text(GlobalUtil.FormatTime(_recodingDurDic[task.Id]), MyStyle).LeftAligned(); + if (_refreshedDurDic == null) + return new Text($"{GlobalUtil.FormatTime(_recodingDurDic[task.Id])}", MyStyle).LeftAligned(); + else + { + return new Text($"{GlobalUtil.FormatTime(_recodingDurDic[task.Id])}/{GlobalUtil.FormatTime(_refreshedDurDic[task.Id])}", GreyStyle); + } } } } diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index 2c93f7f..229d3cf 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -641,7 +641,7 @@ namespace N_m3u8DL_RE.DownloadManager } } - if (STOP_FLAG) + if (STOP_FLAG && source.Count == 0) break; } @@ -720,11 +720,6 @@ namespace N_m3u8DL_RE.DownloadManager Logger.WarnMarkUp($"[darkorange3_1]{ResString.liveLimitReached}[/]"); STOP_FLAG = true; CancellationTokenSource.Cancel(); - - foreach (var target in BlockDic.Values) - { - target.Complete(); - } } }); @@ -743,6 +738,11 @@ namespace N_m3u8DL_RE.DownloadManager { Logger.ErrorMarkUp(e); STOP_FLAG = true; + //停止所有Block + foreach (var target in BlockDic.Values) + { + target.Complete(); + } } } } @@ -825,7 +825,7 @@ namespace N_m3u8DL_RE.DownloadManager progress.Columns(new ProgressColumn[] { new TaskDescriptionColumn() { Alignment = Justify.Left }, - new RecordingDurationColumn(RecordedDurDic), //时长显示 + new RecordingDurationColumn(RecordedDurDic, RefreshedDurDic), //时长显示 new RecordingStatusColumn(), new PercentageColumn(), new DownloadSpeedColumn(SpeedContainerDic), //速度计算 diff --git a/src/N_m3u8DL-RE/Program.cs b/src/N_m3u8DL-RE/Program.cs index 0c4ca8c..4f42c8a 100644 --- a/src/N_m3u8DL-RE/Program.cs +++ b/src/N_m3u8DL-RE/Program.cs @@ -96,6 +96,12 @@ namespace N_m3u8DL_RE throw new ArgumentException("MuxAfterDone disabled, MuxImports not allowed!"); } + if (option.LivePipeMux && !option.LiveRealTimeMerge) + { + Logger.WarnMarkUp("LivePipeMux detected, forced enable LiveRealTimeMerge"); + option.LiveRealTimeMerge = true; + } + //预先检查ffmpeg if (option.FFmpegBinaryPath == null) option.FFmpegBinaryPath = GlobalUtil.FindExecutable("ffmpeg");