diff --git a/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs b/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs index b83d7fb..9ccf4dc 100644 --- a/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs +++ b/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs @@ -25,6 +25,8 @@ namespace N_m3u8DL_RE.Common.Entity public string? Channels { get; set; } public string? Extension { get; set; } + //补充信息-色域 + public string? VideoRange { get; set; } //外部轨道GroupId (后续寻找对应轨道信息) public string? AudioId { get; set; } @@ -58,7 +60,7 @@ namespace N_m3u8DL_RE.Common.Entity else { prefixStr = $"[aqua]Vid[/] {encStr}"; - var d = $"{Resolution} | {Bandwidth / 1000} Kbps | {GroupId} | {FrameRate} | {Codecs}"; + var d = $"{Resolution} | {Bandwidth / 1000} Kbps | {GroupId} | {FrameRate} | {Codecs} | {VideoRange}"; returnStr = d.EscapeMarkup(); } @@ -101,7 +103,7 @@ namespace N_m3u8DL_RE.Common.Entity else { prefixStr = $"[aqua]Vid[/] {encStr}"; - var d = $"{Resolution} | {Bandwidth / 1000} Kbps | {GroupId} | {FrameRate} | {Codecs} | {segmentsCountStr}"; + var d = $"{Resolution} | {Bandwidth / 1000} Kbps | {GroupId} | {FrameRate} | {Codecs} | {VideoRange} | {segmentsCountStr}"; returnStr = d.EscapeMarkup(); } diff --git a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs index 3655d00..ef4c806 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs @@ -125,6 +125,16 @@ namespace N_m3u8DL_RE.Parser.Extractor if (!string.IsNullOrEmpty(subtitleId)) streamSpec.SubtitleId = subtitleId; + var videoRange = ParserUtil.GetAttribute(line, "VIDEO-RANGE"); + if (!string.IsNullOrEmpty(videoRange)) + streamSpec.VideoRange = videoRange; + + //清除多余的编码信息 dvh1.05.06,ec-3 => dvh1.05.06 + if (!string.IsNullOrEmpty(streamSpec.Codecs) && !string.IsNullOrEmpty(streamSpec.AudioId)) + { + streamSpec.Codecs = streamSpec.Codecs.Split(',')[0]; + } + expectPlaylist = true; } else if (line.StartsWith(HLSTags.ext_x_media))