From bbc59e9904f89fa6480eba0dffbc1bc04c6d0a8c Mon Sep 17 00:00:00 2001 From: nilaoda Date: Tue, 11 Oct 2022 22:38:36 +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=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs | 2 +- src/N_m3u8DL-RE/Util/OtherUtil.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs index 3733300..1bdd8ea 100644 --- a/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs +++ b/src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs @@ -584,7 +584,7 @@ namespace N_m3u8DL_RE.DownloadManager private string GetPath(string url) { - return new Uri(url).GetLeftPart(UriPartial.Path); + return url.Split('?').First(); } public async Task StartRecordAsync() diff --git a/src/N_m3u8DL-RE/Util/OtherUtil.cs b/src/N_m3u8DL-RE/Util/OtherUtil.cs index 59b729c..69c602c 100644 --- a/src/N_m3u8DL-RE/Util/OtherUtil.cs +++ b/src/N_m3u8DL-RE/Util/OtherUtil.cs @@ -82,9 +82,8 @@ namespace N_m3u8DL_RE.Util } else { - var uri = new Uri(input); - var name = uri.GetLeftPart(UriPartial.Path).Split('/').Last(); - name = string.Join(".", name.Split('.').SkipLast(1)).Trim('.'); + var uri = new Uri(input.Split('?').First()); + var name = Path.GetFileNameWithoutExtension(uri.LocalPath); saveName = GetValidFileName(name) + "_" + saveName; } return saveName;