From 8743a06d8456c94df175fba96cebf74abbd8a742 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 18 Jun 2023 12:02:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs | 2 +- src/N_m3u8DL-RE/Program.cs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index 0d4c26d..68a541b 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -18,7 +18,7 @@ namespace N_m3u8DL_RE.CommandLine { internal partial class CommandInvoker { - public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20230615"; + public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20230617"; [GeneratedRegex("((best|worst)\\d*|all)")] private static partial Regex ForStrRegex(); diff --git a/src/N_m3u8DL-RE/Program.cs b/src/N_m3u8DL-RE/Program.cs index 5e8e798..967ed0d 100644 --- a/src/N_m3u8DL-RE/Program.cs +++ b/src/N_m3u8DL-RE/Program.cs @@ -207,6 +207,12 @@ namespace N_m3u8DL_RE //可选字幕轨道 var subs = lists.Where(x => x.MediaType == MediaType.SUBTITLES); + //尝试从URL或文件读取文件名 + if (string.IsNullOrEmpty(option.SaveName)) + { + option.SaveName = OtherUtil.GetFileNameFromInput(option.Input); + } + //生成文件夹 var tmpDir = Path.Combine(option.TmpDir ?? Environment.CurrentDirectory, $"{option.SaveName ?? DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}"); //记录文件 @@ -310,11 +316,6 @@ namespace N_m3u8DL_RE Console.ReadKey(); #endif - //尝试从URL或文件读取文件名 - if (string.IsNullOrEmpty(option.SaveName)) - { - option.SaveName = OtherUtil.GetFileNameFromInput(option.Input); - } Logger.InfoMarkUp(ResString.saveName + $"[deepskyblue1]{option.SaveName.EscapeMarkup()}[/]");