优化HLS码率读取

This commit is contained in:
nilaoda 2022-07-17 22:01:18 +08:00
parent 70df8f16f3
commit f36ca8333f
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
if (line.StartsWith(HLSTags.ext_x_stream_inf))
{
streamSpec = new();
var bandwidth = string.IsNullOrEmpty(ParserUtil.GetAttribute(line, "BANDWIDTH")) ? ParserUtil.GetAttribute(line, "AVERAGE-BANDWIDTH") : ParserUtil.GetAttribute(line, "BANDWIDTH");
var bandwidth = string.IsNullOrEmpty(ParserUtil.GetAttribute(line, "AVERAGE-BANDWIDTH")) ? ParserUtil.GetAttribute(line, "BANDWIDTH") : ParserUtil.GetAttribute(line, "AVERAGE-BANDWIDTH");
streamSpec.Bandwidth = Convert.ToInt32(bandwidth);
streamSpec.Codecs = ParserUtil.GetAttribute(line, "CODECS");
streamSpec.Resolution = ParserUtil.GetAttribute(line, "RESOLUTION");
@ -521,7 +521,7 @@ namespace N_m3u8DL_RE.Parser.Extractor
}
else
{
lists[i].Extension = lists[i].Playlist!.MediaInit != null ? "mp4" : "ts";
lists[i].Extension = lists[i].Playlist!.MediaInit != null ? "m4s" : "ts";
}
}
}