From 2ee9ab234f0aed17cd929767cd1b46fb50265949 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Thu, 26 May 2022 20:18:05 +0800 Subject: [PATCH] fix #665 #661 --- N_m3u8DL-CLI/Global.cs | 2 +- N_m3u8DL-CLI/Program.cs | 8 ++++++-- N_m3u8DL-CLI/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/N_m3u8DL-CLI/Global.cs b/N_m3u8DL-CLI/Global.cs index 8aa5282..315a8fa 100644 --- a/N_m3u8DL-CLI/Global.cs +++ b/N_m3u8DL-CLI/Global.cs @@ -35,7 +35,7 @@ class Global /*===============================================================================*/ static Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; static string nowVer = $"{ver.Major}.{ver.Minor}.{ver.Build}"; - static string nowDate = "20220524"; + static string nowDate = "20220526"; public static void WriteInit() { Console.WriteLine($"N_m3u8DL-CLI version {nowVer} 2018-2022"); diff --git a/N_m3u8DL-CLI/Program.cs b/N_m3u8DL-CLI/Program.cs index cffc692..34f39ec 100644 --- a/N_m3u8DL-CLI/Program.cs +++ b/N_m3u8DL-CLI/Program.cs @@ -77,8 +77,12 @@ static void Main(string[] args) { if (args[0].ToLower().StartsWith("m3u8dl:")) { - var valueBytes = Convert.FromBase64String(args[0].Substring(7)); - var cmd = Encoding.UTF8.GetString(valueBytes); + var base64 = args[0].Replace("m3u8dl://", "").Replace("m3u8dl:", ""); + var cmd = ""; + try { cmd = Encoding.UTF8.GetString(Convert.FromBase64String(base64)); } + catch (FormatException) { cmd = Encoding.UTF8.GetString(Convert.FromBase64String(base64.TrimEnd('/'))); } + //修正工作目录 + Environment.CurrentDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); args = Global.ParseArguments(cmd).ToArray(); //解析命令行 } else if (args[0] == "--registerUrlProtocol") diff --git a/N_m3u8DL-CLI/Properties/AssemblyInfo.cs b/N_m3u8DL-CLI/Properties/AssemblyInfo.cs index 1e3137f..43cd5e5 100644 --- a/N_m3u8DL-CLI/Properties/AssemblyInfo.cs +++ b/N_m3u8DL-CLI/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyFileVersion("3.0.0.0")] +[assembly: AssemblyVersion("3.0.1.0")] +[assembly: AssemblyFileVersion("3.0.1.0")]