From ecb01fcca3df6dc389be2b072d7c7f2f5d0be24a Mon Sep 17 00:00:00 2001 From: nilaoda Date: Wed, 14 Jun 2023 23:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B0=E5=AF=8C=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/Entity/StreamFilter.cs | 21 +++++++++++++++++++++ src/N_m3u8DL-RE/Program.cs | 15 +++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/N_m3u8DL-RE/Entity/StreamFilter.cs b/src/N_m3u8DL-RE/Entity/StreamFilter.cs index 1092bc7..f260cda 100644 --- a/src/N_m3u8DL-RE/Entity/StreamFilter.cs +++ b/src/N_m3u8DL-RE/Entity/StreamFilter.cs @@ -25,5 +25,26 @@ namespace N_m3u8DL_RE.Entity public double? PlaylistMaxDur { get; set; } public string For { get; set; } = "best"; + + public override string? ToString() + { + var sb = new StringBuilder(); + + if (GroupIdReg != null) sb.Append($"GroupIdReg: {GroupIdReg} "); + if (LanguageReg != null) sb.Append($"LanguageReg: {LanguageReg} "); + if (NameReg != null) sb.Append($"NameReg: {NameReg} "); + if (CodecsReg != null) sb.Append($"CodecsReg: {CodecsReg} "); + if (ResolutionReg != null) sb.Append($"ResolutionReg: {ResolutionReg} "); + if (FrameRateReg != null) sb.Append($"FrameRateReg: {FrameRateReg} "); + if (ChannelsReg != null) sb.Append($"ChannelsReg: {ChannelsReg} "); + if (VideoRangeReg != null) sb.Append($"VideoRangeReg: {VideoRangeReg} "); + if (UrlReg != null) sb.Append($"UrlReg: {UrlReg} "); + if (SegmentsMinCount != null) sb.Append($"SegmentsMinCount: {SegmentsMinCount} "); + if (SegmentsMaxCount != null) sb.Append($"SegmentsMaxCount: {SegmentsMaxCount} "); + if (PlaylistMinDur != null) sb.Append($"PlaylistMinDur: {PlaylistMinDur} "); + if (PlaylistMaxDur != null) sb.Append($"PlaylistMaxDur: {PlaylistMaxDur} "); + + return sb.ToString() + $"For: {For}"; + } } } diff --git a/src/N_m3u8DL-RE/Program.cs b/src/N_m3u8DL-RE/Program.cs index 5168a60..5e8e798 100644 --- a/src/N_m3u8DL-RE/Program.cs +++ b/src/N_m3u8DL-RE/Program.cs @@ -105,7 +105,7 @@ namespace N_m3u8DL_RE throw new FileNotFoundException(ResString.ffmpegNotFound); } - Logger.Extra($"ffmpeg: {option.FFmpegBinaryPath}"); + Logger.Extra($"ffmpeg => {option.FFmpegBinaryPath}"); //预先检查mkvmerge if (option.UseMkvmerge && option.MuxAfterDone) @@ -116,7 +116,7 @@ namespace N_m3u8DL_RE { throw new FileNotFoundException("mkvmerge not found"); } - Logger.Extra($"mkvmerge: {option.MkvmergeBinaryPath}"); + Logger.Extra($"mkvmerge => {option.MkvmergeBinaryPath}"); } //预先检查 @@ -132,14 +132,14 @@ namespace N_m3u8DL_RE var file4 = GlobalUtil.FindExecutable("packager-win-x64"); if (file == null && file2 == null && file3 == null && file4 == null) throw new FileNotFoundException("shaka-packager not found!"); option.DecryptionBinaryPath = file ?? file2 ?? file3 ?? file4; - Logger.Extra($"shaka-packager: {option.DecryptionBinaryPath}"); + Logger.Extra($"shaka-packager => {option.DecryptionBinaryPath}"); } else { var file = GlobalUtil.FindExecutable("mp4decrypt"); if (file == null) throw new FileNotFoundException("mp4decrypt not found!"); option.DecryptionBinaryPath = file; - Logger.Extra($"mp4decrypt: {option.DecryptionBinaryPath}"); + Logger.Extra($"mp4decrypt => {option.DecryptionBinaryPath}"); } } else if (!File.Exists(option.DecryptionBinaryPath)) @@ -230,6 +230,13 @@ namespace N_m3u8DL_RE lists = basicStreams.Concat(audios).Concat(subs).OrderBy(x => true); } + if (option.DropVideoFilter != null) Logger.Extra($"DropVideoFilter => {option.DropVideoFilter}"); + if (option.DropAudioFilter != null) Logger.Extra($"DropAudioFilter => {option.DropAudioFilter}"); + if (option.DropSubtitleFilter != null) Logger.Extra($"DropSubtitleFilter => {option.DropSubtitleFilter}"); + if (option.VideoFilter != null) Logger.Extra($"VideoFilter => {option.VideoFilter}"); + if (option.AudioFilter != null) Logger.Extra($"AudioFilter => {option.AudioFilter}"); + if (option.SubtitleFilter != null) Logger.Extra($"SubtitleFilter => {option.SubtitleFilter}"); + if (option.AutoSelect) { if (basicStreams.Any())