diff --git a/DownKyi/Services/Download/AddToDownloadService.cs b/DownKyi/Services/Download/AddToDownloadService.cs index f6d1273..09d89d6 100644 --- a/DownKyi/Services/Download/AddToDownloadService.cs +++ b/DownKyi/Services/Download/AddToDownloadService.cs @@ -302,7 +302,7 @@ namespace DownKyi.Services.Download .SetBvid(page.Bvid) .SetCid(page.Cid) .SetUpMid(page.Owner.Mid) - .SetUpName(page.Owner.Name); + .SetUpName(Format.FormatFileName(page.Owner.Name)); string filePath = Path.Combine(directory, fileName.RelativePath()); // 视频类别 diff --git a/DownKyi/Services/Download/AriaDownloadService.cs b/DownKyi/Services/Download/AriaDownloadService.cs index ff5d656..ef03104 100644 --- a/DownKyi/Services/Download/AriaDownloadService.cs +++ b/DownKyi/Services/Download/AriaDownloadService.cs @@ -138,7 +138,8 @@ namespace DownKyi.Services.Download // 路径 string[] temp = downloading.DownloadBase.FilePath.Split('/'); - string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], ""); + //string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], ""); + string path = downloading.DownloadBase.FilePath.TrimEnd(temp[temp.Length - 1].ToCharArray()); // 下载文件名 string fileName = Guid.NewGuid().ToString("N"); @@ -581,7 +582,9 @@ namespace DownKyi.Services.Download { // 路径 string[] temp = downloading.DownloadBase.FilePath.Split('/'); - string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], ""); + //string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], ""); + string path = downloading.DownloadBase.FilePath.TrimEnd(temp[temp.Length - 1].ToCharArray()); + // 路径不存在则创建 if (!Directory.Exists(path)) {