diff --git a/src/Jackett.Common/Indexers/Abstract/XtremeZoneTracker.cs b/src/Jackett.Common/Indexers/Abstract/XtremeZoneTracker.cs index 6062b3006..ddeb717ba 100644 --- a/src/Jackett.Common/Indexers/Abstract/XtremeZoneTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/XtremeZoneTracker.cs @@ -174,8 +174,8 @@ namespace Jackett.Common.Indexers.Abstract response = await RequestBytesWithCookies(link.ToString(), headers: GetSearchHeaders()); } else if (response.Status != HttpStatusCode.OK) - throw new Exception($"Unknown error in download: {response.Content}"); - return response.Content; + throw new Exception($"Unknown error in download: {response.ContentBytes}"); + return response.ContentBytes; } private Dictionary GetSearchHeaders() => new Dictionary diff --git a/src/Jackett.Common/Indexers/BakaBT.cs b/src/Jackett.Common/Indexers/BakaBT.cs index e78128e3f..80efa758c 100644 --- a/src/Jackett.Common/Indexers/BakaBT.cs +++ b/src/Jackett.Common/Indexers/BakaBT.cs @@ -255,7 +255,7 @@ namespace Jackett.Common.Indexers throw new Exception("Unable to find download link."); var response = await RequestBytesWithCookies(SiteLink + downloadLink); - return response.Content; + return response.ContentBytes; } } } diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index 69db2dfac..1883e2eb2 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -404,12 +404,12 @@ namespace Jackett.Common.Indexers if (response.Status != System.Net.HttpStatusCode.OK && response.Status != System.Net.HttpStatusCode.Continue && response.Status != System.Net.HttpStatusCode.PartialContent) { logger.Error("Failed download cookies: " + CookieHeader); - if (response.Content != null) - logger.Error("Failed download response:\n" + Encoding.UTF8.GetString(response.Content)); + if (response.ContentBytes != null) + logger.Error("Failed download response:\n" + Encoding.UTF8.GetString(response.ContentBytes)); throw new Exception($"Remote server returned {response.Status.ToString()}" + (response.IsRedirect ? " => " + response.RedirectingTo : "")); } - return response.Content; + return response.ContentBytes; } protected async Task RequestBytesWithCookiesAndRetry(string url, string cookieOverride = null, RequestType method = RequestType.GET, string referer = null, IEnumerable> data = null) diff --git a/src/Jackett.Common/Indexers/CardigannIndexer.cs b/src/Jackett.Common/Indexers/CardigannIndexer.cs index ef15fe2b0..f0dd0ff6c 100644 --- a/src/Jackett.Common/Indexers/CardigannIndexer.cs +++ b/src/Jackett.Common/Indexers/CardigannIndexer.cs @@ -933,7 +933,7 @@ namespace Jackett.Common.Indexers var CaptchaImage = new ImageItem { Name = "Captcha Image" }; var CaptchaText = new StringItem { Name = "Captcha Text" }; - CaptchaImage.Value = captchaImageData.Content; + CaptchaImage.Value = captchaImageData.ContentBytes; configData.AddDynamic("CaptchaImage", CaptchaImage); configData.AddDynamic("CaptchaText", CaptchaText); diff --git a/src/Jackett.Common/Indexers/LostFilm.cs b/src/Jackett.Common/Indexers/LostFilm.cs index 705cc1c37..d2cff3a96 100644 --- a/src/Jackett.Common/Indexers/LostFilm.cs +++ b/src/Jackett.Common/Indexers/LostFilm.cs @@ -121,7 +121,7 @@ namespace Jackett.Common.Indexers { var captchaUrl = SiteLink + qCaptchaImg.GetAttribute("src"); var captchaImage = await RequestBytesWithCookies(captchaUrl, loginPage.Cookies); - configData.CaptchaImage.Value = captchaImage.Content; + configData.CaptchaImage.Value = captchaImage.ContentBytes; } else { diff --git a/src/Jackett.Common/Indexers/PixelHD.cs b/src/Jackett.Common/Indexers/PixelHD.cs index 465e73c11..2814aa60d 100644 --- a/src/Jackett.Common/Indexers/PixelHD.cs +++ b/src/Jackett.Common/Indexers/PixelHD.cs @@ -70,7 +70,7 @@ namespace Jackett.Common.Indexers input_captcha = catchaInput.GetAttribute("name"); var captchaImage = await RequestBytesWithCookies(SiteLink + catchaImg.GetAttribute("src"), loginPage.Cookies, RequestType.GET, LoginUrl); - configData.CaptchaImage.Value = captchaImage.Content; + configData.CaptchaImage.Value = captchaImage.ContentBytes; } else { diff --git a/src/Jackett.Common/Indexers/PornoLab.cs b/src/Jackett.Common/Indexers/PornoLab.cs index f8fcbda63..d86068011 100644 --- a/src/Jackett.Common/Indexers/PornoLab.cs +++ b/src/Jackett.Common/Indexers/PornoLab.cs @@ -190,7 +190,7 @@ namespace Jackett.Common.Indexers if (captchaimg != null) { var captchaImage = await RequestBytesWithCookies("https:" + captchaimg.GetAttribute("src")); - configData.CaptchaImage.Value = captchaImage.Content; + configData.CaptchaImage.Value = captchaImage.ContentBytes; var codefield = LoginResultDocument.QuerySelector("input[name^=\"cap_code_\"]"); cap_code_field = codefield.GetAttribute("name"); diff --git a/src/Jackett.Common/Indexers/RuTracker.cs b/src/Jackett.Common/Indexers/RuTracker.cs index cb7d26856..d63cea89c 100644 --- a/src/Jackett.Common/Indexers/RuTracker.cs +++ b/src/Jackett.Common/Indexers/RuTracker.cs @@ -1517,7 +1517,7 @@ namespace Jackett.Common.Indexers if (captchaimg != null) { var captchaImage = await RequestBytesWithCookies(captchaimg.GetAttribute("src")); - configData.CaptchaImage.Value = captchaImage.Content; + configData.CaptchaImage.Value = captchaImage.ContentBytes; var codefield = doc.QuerySelector("input[name^=\"cap_code_\"]"); _capCodeField = codefield.GetAttribute("name"); diff --git a/src/Jackett.Common/Indexers/TorrentHeaven.cs b/src/Jackett.Common/Indexers/TorrentHeaven.cs index 8e9b3f501..be7f398e7 100644 --- a/src/Jackett.Common/Indexers/TorrentHeaven.cs +++ b/src/Jackett.Common/Indexers/TorrentHeaven.cs @@ -136,7 +136,7 @@ namespace Jackett.Common.Indexers { var captchaUrl = SiteLink + qCaptchaImg.GetAttribute("src"); var captchaImage = await RequestBytesWithCookies(captchaUrl, loginPage.Cookies); - configData.CaptchaImage.Value = captchaImage.Content; + configData.CaptchaImage.Value = captchaImage.ContentBytes; } else configData.CaptchaImage.Value = Array.Empty(); diff --git a/src/Jackett.Common/Indexers/XSpeeds.cs b/src/Jackett.Common/Indexers/XSpeeds.cs index d6f20fac9..3a918d122 100644 --- a/src/Jackett.Common/Indexers/XSpeeds.cs +++ b/src/Jackett.Common/Indexers/XSpeeds.cs @@ -142,7 +142,7 @@ namespace Jackett.Common.Indexers var captchaImageResponse = await RequestBytesWithCookies(captchaUrl, loginPage.Cookies, RequestType.GET, LandingUrl); var captchaText = new StringItem { Name = "Captcha Text" }; - var captchaImage = new ImageItem {Name = "Captcha Image", Value = captchaImageResponse.Content}; + var captchaImage = new ImageItem {Name = "Captcha Image", Value = captchaImageResponse.ContentBytes}; configData.AddDynamic("CaptchaText", captchaText); configData.AddDynamic("CaptchaImage", captchaImage); diff --git a/src/Jackett.Common/Services/UpdateService.cs b/src/Jackett.Common/Services/UpdateService.cs index 8dbcbf11f..0d4f28d60 100644 --- a/src/Jackett.Common/Services/UpdateService.cs +++ b/src/Jackett.Common/Services/UpdateService.cs @@ -277,14 +277,14 @@ namespace Jackett.Common.Services if (isWindows) { var zipPath = Path.Combine(tempDir, "Update.zip"); - File.WriteAllBytes(zipPath, data.Content); + File.WriteAllBytes(zipPath, data.ContentBytes); var fastZip = new FastZip(); fastZip.ExtractZip(zipPath, tempDir, null); } else { var gzPath = Path.Combine(tempDir, "Update.tar.gz"); - File.WriteAllBytes(gzPath, data.Content); + File.WriteAllBytes(gzPath, data.ContentBytes); Stream inStream = File.OpenRead(gzPath); Stream gzipStream = new GZipInputStream(inStream); diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient.cs index 8bc4a4185..6496ad5c8 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClient.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClient.cs @@ -216,7 +216,7 @@ namespace Jackett.Common.Utils.Clients { var result = new WebClientByteResult { - Content = await response.Content.ReadAsByteArrayAsync() + ContentBytes = await response.Content.ReadAsByteArrayAsync() }; foreach (var header in response.Headers) diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs index 367288e84..a5999d4de 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs @@ -235,7 +235,7 @@ namespace Jackett.Common.Utils.Clients var result = new WebClientByteResult { - Content = await response.Content.ReadAsByteArrayAsync() + ContentBytes = await response.Content.ReadAsByteArrayAsync() }; foreach (var header in response.Headers) diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs index 796b70a9c..131924b64 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs @@ -231,7 +231,7 @@ namespace Jackett.Common.Utils.Clients var result = new WebClientByteResult { - Content = await response.Content.ReadAsByteArrayAsync() + ContentBytes = await response.Content.ReadAsByteArrayAsync() }; foreach (var header in response.Headers) diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs b/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs index 8262744de..58411a364 100644 --- a/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs +++ b/src/Jackett.Common/Utils/Clients/HttpWebClientNetCore.cs @@ -215,7 +215,7 @@ namespace Jackett.Common.Utils.Clients { var result = new WebClientByteResult { - Content = await response.Content.ReadAsByteArrayAsync() + ContentBytes = await response.Content.ReadAsByteArrayAsync() }; foreach (var header in response.Headers) diff --git a/src/Jackett.Common/Utils/Clients/WebByteResult.cs b/src/Jackett.Common/Utils/Clients/WebByteResult.cs index 102d7f201..350eea264 100644 --- a/src/Jackett.Common/Utils/Clients/WebByteResult.cs +++ b/src/Jackett.Common/Utils/Clients/WebByteResult.cs @@ -2,6 +2,6 @@ namespace Jackett.Common.Utils.Clients { public class WebClientByteResult : BaseWebResult { - public byte[] Content { get; set; } + public byte[] ContentBytes { get; set; } } } diff --git a/src/Jackett.Common/Utils/Clients/WebClient.cs b/src/Jackett.Common/Utils/Clients/WebClient.cs index 2b0dca34a..876a6a970 100644 --- a/src/Jackett.Common/Utils/Clients/WebClient.cs +++ b/src/Jackett.Common/Utils/Clients/WebClient.cs @@ -102,7 +102,7 @@ namespace Jackett.Common.Utils.Clients var result = await Run(request); lastRequest = DateTime.Now; result.Request = request; - logger.Debug(string.Format("WebClient({0}): Returning {1} => {2} bytes", ClientType, result.Status, (result.IsRedirect ? result.RedirectingTo + " " : "") + (result.Content == null ? "" : result.Content.Length.ToString()))); + logger.Debug(string.Format("WebClient({0}): Returning {1} => {2} bytes", ClientType, result.Status, (result.IsRedirect ? result.RedirectingTo + " " : "") + (result.ContentBytes == null ? "" : result.ContentBytes.Length.ToString()))); return result; } @@ -117,8 +117,8 @@ namespace Jackett.Common.Utils.Clients var stringResult = Mapper.Map(result); string decodedContent = null; - if (result.Content != null) - decodedContent = result.Encoding.GetString(result.Content); + if (result.ContentBytes != null) + decodedContent = result.Encoding.GetString(result.ContentBytes); stringResult.ContentString = decodedContent; logger.Debug(string.Format("WebClient({0}): Returning {1} => {2}", ClientType, result.Status, (result.IsRedirect ? result.RedirectingTo + " " : "") + (decodedContent == null ? "" : decodedContent))); diff --git a/src/Jackett.Server/Helper.cs b/src/Jackett.Server/Helper.cs index 5a1aeb9d0..43d3c36c5 100644 --- a/src/Jackett.Server/Helper.cs +++ b/src/Jackett.Server/Helper.cs @@ -76,15 +76,15 @@ namespace Jackett.Server cfg.CreateMap().ForMember(x => x.ContentString, opt => opt.Ignore()).AfterMap((be, str) => { var encoding = be.Request.Encoding ?? Encoding.UTF8; - str.ContentString = encoding.GetString(be.Content); + str.ContentString = encoding.GetString(be.ContentBytes); }); - cfg.CreateMap().ForMember(x => x.Content, opt => opt.Ignore()).AfterMap((str, be) => + cfg.CreateMap().ForMember(x => x.ContentBytes, opt => opt.Ignore()).AfterMap((str, be) => { if (!string.IsNullOrEmpty(str.ContentString)) { var encoding = str.Request.Encoding ?? Encoding.UTF8; - be.Content = encoding.GetBytes(str.ContentString); + be.ContentBytes = encoding.GetBytes(str.ContentString); } });