直播下刷新列表增加默认异常重试

This commit is contained in:
nilaoda 2022-09-28 10:43:18 +08:00
parent cca807b2c1
commit 4579334a3f
3 changed files with 21 additions and 2 deletions

3
.gitignore vendored
View File

@ -16,6 +16,9 @@
# Mono auto generated files
mono_crash.*
# Properties
Properties/
# Build results
[Dd]ebug/
[Dd]ebugPublic/

View File

@ -6,6 +6,7 @@ using N_m3u8DL_RE.Parser.Constants;
using N_m3u8DL_RE.Parser.Extractor;
using N_m3u8DL_RE.Common.Util;
using N_m3u8DL_RE.Common.Enum;
using Spectre.Console;
namespace N_m3u8DL_RE.Parser
{
@ -114,8 +115,23 @@ namespace N_m3u8DL_RE.Parser
try
{
await semaphore.WaitAsync();
int retryCount = 3; //增加重试
reGet:
try
{
await extractor.RefreshPlayListAsync(streamSpecs);
}
catch (Exception ex)
{
if (retryCount-- > 0)
{
Logger.WarnMarkUp($"[grey]Refresh Exception: {ex.Message.EscapeMarkup()} retryCount: {retryCount}[/]");
await Task.Delay(300);
goto reGet;
}
else throw;
}
}
finally
{
semaphore.Release();

View File

@ -433,7 +433,7 @@ namespace N_m3u8DL_RE.CommandLine
Environment.Exit(0);
}
var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20220927")
var rootCommand = new RootCommand("N_m3u8DL-RE (Beta version) 20220928")
{
Input, TmpDir, SaveDir, SaveName, BaseUrl, ThreadCount, DownloadRetryCount, AutoSelect, SkipMerge, SkipDownload, CheckSegmentsCount,
BinaryMerge, DelAfterDone, WriteMetaJson, AppendUrlParams, ConcurrentDownload, Headers, /**SavePattern,**/ SubOnly, SubtitleFormat, AutoSubtitleFix,