优化文件名读取
This commit is contained in:
parent
c8e44202bd
commit
8743a06d84
|
@ -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();
|
||||
|
|
|
@ -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()}[/]");
|
||||
|
||||
|
|
Loading…
Reference in New Issue