优化直播识别

This commit is contained in:
nilaoda 2022-09-18 18:53:06 +08:00
parent 71e60af5f3
commit 005d012558
1 changed files with 7 additions and 7 deletions

View File

@ -185,13 +185,6 @@ namespace N_m3u8DL_RE
//解析流信息 //解析流信息
var streams = await extractor.ExtractStreamsAsync(); var streams = await extractor.ExtractStreamsAsync();
//直播检测
var livingFlag = streams.Any(s => s.Playlist?.IsLive == true) && !option.LivePerformAsVod;
if (livingFlag)
{
Logger.WarnMarkUp($"[white on darkorange3_1]{ResString.liveFound}[/]");
}
//全部媒体 //全部媒体
var lists = streams.OrderBy(p => p.MediaType).ThenByDescending(p => p.Bandwidth).ThenByDescending(GetOrder); var lists = streams.OrderBy(p => p.MediaType).ThenByDescending(p => p.Bandwidth).ThenByDescending(GetOrder);
//基本流 //基本流
@ -251,6 +244,13 @@ namespace N_m3u8DL_RE
if (selectedStreams.Any(s => s.Playlist == null) || extractor.ExtractorType == ExtractorType.MPEG_DASH) if (selectedStreams.Any(s => s.Playlist == null) || extractor.ExtractorType == ExtractorType.MPEG_DASH)
await extractor.FetchPlayListAsync(selectedStreams); await extractor.FetchPlayListAsync(selectedStreams);
//直播检测
var livingFlag = selectedStreams.Any(s => s.Playlist?.IsLive == true) && !option.LivePerformAsVod;
if (livingFlag)
{
Logger.WarnMarkUp($"[white on darkorange3_1]{ResString.liveFound}[/]");
}
//无法识别的加密方式,自动开启二进制合并 //无法识别的加密方式,自动开启二进制合并
if (selectedStreams.Any(s => s.Playlist.MediaParts.Any(p => p.MediaSegments.Any(m => m.EncryptInfo.Method == EncryptMethod.UNKNOWN)))) if (selectedStreams.Any(s => s.Playlist.MediaParts.Any(p => p.MediaSegments.Any(m => m.EncryptInfo.Method == EncryptMethod.UNKNOWN))))
{ {