From dbc09f99cbf8f9858e020b6f3cbc998af8236ceb Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sat, 27 Aug 2022 20:13:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=86=E5=88=ABCharacteristics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs | 4 +++- src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs b/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs index 9ccf4dc..932d2c5 100644 --- a/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs +++ b/src/N_m3u8DL-RE.Common/Entity/StreamSpec.cs @@ -27,6 +27,8 @@ namespace N_m3u8DL_RE.Common.Entity //补充信息-色域 public string? VideoRange { get; set; } + //补充信息-特征 + public string? Characteristics { get; set; } //外部轨道GroupId (后续寻找对应轨道信息) public string? AudioId { get; set; } @@ -97,7 +99,7 @@ namespace N_m3u8DL_RE.Common.Entity else if (MediaType == Enum.MediaType.SUBTITLES) { prefixStr = $"[deepskyblue3_1]Sub[/] {encStr}"; - var d = $"{GroupId} | {Language} | {Name} | {Codecs} | {segmentsCountStr}"; + var d = $"{GroupId} | {Language} | {Name} | {Codecs} | {Characteristics} | {segmentsCountStr}"; returnStr = d.EscapeMarkup(); } else diff --git a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs index ef4c806..6803a6e 100644 --- a/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs +++ b/src/N_m3u8DL-RE.Parser/Extractor/HLSExtractor.cs @@ -196,6 +196,10 @@ namespace N_m3u8DL_RE.Parser.Extractor if (!string.IsNullOrEmpty(channels)) streamSpec.Channels = channels; + var characteristics = ParserUtil.GetAttribute(line, "CHARACTERISTICS"); + if (!string.IsNullOrEmpty(characteristics)) + streamSpec.Characteristics = characteristics.Split(',').Last().Split('.').Last(); + streams.Add(streamSpec); } else if (line.StartsWith("#"))