diff --git a/src/NzbDrone.Core/Download/DownloadMappingService.cs b/src/NzbDrone.Core/Download/DownloadMappingService.cs index a3dbcc539..812087c47 100644 --- a/src/NzbDrone.Core/Download/DownloadMappingService.cs +++ b/src/NzbDrone.Core/Download/DownloadMappingService.cs @@ -36,7 +36,7 @@ namespace NzbDrone.Core.Download var encryptedLink = _protectionService.Protect(link.ToString()); var encodedLink = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(encryptedLink)); - var urlEncodedFile = WebUtility.UrlEncode(file); + var urlEncodedFile = Uri.EscapeDataString(file); var proxyLink = $"{serverUrl}{urlBase}/{indexerId}/download?apikey={_configFileProvider.ApiKey}&link={encodedLink}&file={urlEncodedFile}"; return new Uri(proxyLink); } diff --git a/src/NzbDrone.Core/Indexers/Definitions/BakaBT.cs b/src/NzbDrone.Core/Indexers/Definitions/BakaBT.cs index 8595a16d1..20824838d 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/BakaBT.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/BakaBT.cs @@ -184,7 +184,7 @@ namespace NzbDrone.Core.Indexers.Definitions searchString = match.Value; } - var episodeSearchUrl = searchUrl + WebUtility.UrlEncode(searchString); + var episodeSearchUrl = searchUrl + Uri.EscapeDataString(searchString); var request = new IndexerRequest(episodeSearchUrl, null); diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs index 2622142cd..0ca06a2d4 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs @@ -1013,7 +1013,7 @@ namespace NzbDrone.Core.Indexers.Cardigann // build search URL // HttpUtility.UrlPathEncode seems to only encode spaces, we use UrlEncode and replace + with %20 as a workaround - var searchUrl = ResolvePath(ApplyGoTemplateText(searchPath.Path, variables, WebUtility.UrlEncode).Replace("+", "%20")).AbsoluteUri; + var searchUrl = ResolvePath(ApplyGoTemplateText(searchPath.Path, variables, Uri.EscapeDataString).Replace("+", "%20")).AbsoluteUri; var queryCollection = new List>(); var method = HttpMethod.Get; @@ -1038,7 +1038,7 @@ namespace NzbDrone.Core.Indexers.Cardigann { if (input.Key == "$raw") { - var rawStr = ApplyGoTemplateText(input.Value, variables, WebUtility.UrlEncode); + var rawStr = ApplyGoTemplateText(input.Value, variables, Uri.EscapeDataString); foreach (var part in rawStr.Split('&')) { var parts = part.Split(new char[] { '=' }, 2); diff --git a/src/NzbDrone.Core/Indexers/Definitions/ImmortalSeed.cs b/src/NzbDrone.Core/Indexers/Definitions/ImmortalSeed.cs index 59d3bb07d..c8a8cb0ab 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/ImmortalSeed.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/ImmortalSeed.cs @@ -174,7 +174,7 @@ namespace NzbDrone.Core.Indexers.Definitions if (term.IsNotNullOrWhiteSpace()) { - searchUrl += string.Format("?do=search&keywords={0}&search_type=t_name&category=0&include_dead_torrents=no", WebUtility.UrlEncode(term)); + searchUrl += string.Format("?do=search&keywords={0}&search_type=t_name&category=0&include_dead_torrents=no", Uri.EscapeDataString(term)); } if (categories != null && categories.Length > 0) diff --git a/src/NzbDrone.Core/Indexers/Definitions/TorrentLeech.cs b/src/NzbDrone.Core/Indexers/Definitions/TorrentLeech.cs index 065ab7481..8da22b1a8 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/TorrentLeech.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/TorrentLeech.cs @@ -192,7 +192,7 @@ namespace NzbDrone.Core.Indexers.Definitions } else if (!string.IsNullOrWhiteSpace(searchString)) { - searchUrl += "exact/1/query/" + WebUtility.UrlEncode(searchString) + "/"; + searchUrl += "exact/1/query/" + Uri.EscapeDataString(searchString) + "/"; } var cats = Capabilities.Categories.MapTorznabCapsToTrackers(categories);