From b1c70b723fcaf23fd1b5a1c6d241420edc9b9b67 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Sun, 7 Feb 2021 21:59:47 -0700 Subject: [PATCH] Url decode the filename, sometimes RD would return a url encoded string, sometimes not. --- server/RdtClient.Service/Services/DownloadClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/RdtClient.Service/Services/DownloadClient.cs b/server/RdtClient.Service/Services/DownloadClient.cs index e492071..17bb87f 100644 --- a/server/RdtClient.Service/Services/DownloadClient.cs +++ b/server/RdtClient.Service/Services/DownloadClient.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Net; using System.Threading.Tasks; +using System.Web; using Downloader; using RdtClient.Data.Models.Data; using RdtClient.Service.Helpers; @@ -61,6 +62,9 @@ namespace RdtClient.Service.Services } var fileName = uri.Segments.Last(); + + fileName = HttpUtility.UrlDecode(fileName); + var filePath = Path.Combine(torrentPath, fileName); if (File.Exists(filePath))