diff --git a/.gitignore b/.gitignore index 4b0547a..707da68 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ # Mono auto generated files mono_crash.* +# Properties +Properties/ + # Build results [Dd]ebug/ [Dd]ebugPublic/ diff --git a/src/N_m3u8DL-RE.Parser/StreamExtractor.cs b/src/N_m3u8DL-RE.Parser/StreamExtractor.cs index b487a49..06e7aa9 100644 --- a/src/N_m3u8DL-RE.Parser/StreamExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/StreamExtractor.cs @@ -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,7 +115,22 @@ namespace N_m3u8DL_RE.Parser try { await semaphore.WaitAsync(); - await extractor.RefreshPlayListAsync(streamSpecs); + 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 { diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index fae7c67..691e80c 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -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,