diff --git a/src/Jackett.Common/Indexers/Abstract/XtremeZoneTracker.cs b/src/Jackett.Common/Indexers/Abstract/XtremeZoneTracker.cs index ddeb717ba..6062b3006 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.ContentBytes}"); - return response.ContentBytes; + throw new Exception($"Unknown error in download: {response.Content}"); + return response.Content; } private Dictionary GetSearchHeaders() => new Dictionary diff --git a/src/Jackett.Common/Indexers/BakaBT.cs b/src/Jackett.Common/Indexers/BakaBT.cs index 80efa758c..e78128e3f 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.ContentBytes; + return response.Content; } } } diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index 1883e2eb2..69db2dfac 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.ContentBytes != null) - logger.Error("Failed download response:\n" + Encoding.UTF8.GetString(response.ContentBytes)); + if (response.Content != null) + logger.Error("Failed download response:\n" + Encoding.UTF8.GetString(response.Content)); throw new Exception($"Remote server returned {response.Status.ToString()}" + (response.IsRedirect ? " => " + response.RedirectingTo : "")); } - return response.ContentBytes; + return response.Content; } 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 f0dd0ff6c..ef15fe2b0 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.ContentBytes; + CaptchaImage.Value = captchaImageData.Content; 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 d2cff3a96..705cc1c37 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.ContentBytes; + configData.CaptchaImage.Value = captchaImage.Content; } else { diff --git a/src/Jackett.Common/Indexers/PixelHD.cs b/src/Jackett.Common/Indexers/PixelHD.cs index 2814aa60d..465e73c11 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.ContentBytes; + configData.CaptchaImage.Value = captchaImage.Content; } else { diff --git a/src/Jackett.Common/Indexers/PornoLab.cs b/src/Jackett.Common/Indexers/PornoLab.cs index d86068011..f8fcbda63 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.ContentBytes; + configData.CaptchaImage.Value = captchaImage.Content; 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 d63cea89c..cb7d26856 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.ContentBytes; + configData.CaptchaImage.Value = captchaImage.Content; 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 be7f398e7..8e9b3f501 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.ContentBytes; + configData.CaptchaImage.Value = captchaImage.Content; } else configData.CaptchaImage.Value = Array.Empty(); diff --git a/src/Jackett.Common/Indexers/XSpeeds.cs b/src/Jackett.Common/Indexers/XSpeeds.cs index 3a918d122..d6f20fac9 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.ContentBytes}; + var captchaImage = new ImageItem {Name = "Captcha Image", Value = captchaImageResponse.Content}; 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 0d4f28d60..8dbcbf11f 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.ContentBytes); + File.WriteAllBytes(zipPath, data.Content); var fastZip = new FastZip(); fastZip.ExtractZip(zipPath, tempDir, null); } else { var gzPath = Path.Combine(tempDir, "Update.tar.gz"); - File.WriteAllBytes(gzPath, data.ContentBytes); + File.WriteAllBytes(gzPath, data.Content); 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 6496ad5c8..8bc4a4185 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 { - ContentBytes = await response.Content.ReadAsByteArrayAsync() + Content = 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 a5999d4de..367288e84 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 { - ContentBytes = await response.Content.ReadAsByteArrayAsync() + Content = 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 131924b64..796b70a9c 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 { - ContentBytes = await response.Content.ReadAsByteArrayAsync() + Content = 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 58411a364..8262744de 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 { - ContentBytes = await response.Content.ReadAsByteArrayAsync() + Content = 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 350eea264..102d7f201 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[] ContentBytes { get; set; } + public byte[] Content { get; set; } } } diff --git a/src/Jackett.Common/Utils/Clients/WebClient.cs b/src/Jackett.Common/Utils/Clients/WebClient.cs index 876a6a970..2b0dca34a 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.ContentBytes == null ? "" : result.ContentBytes.Length.ToString()))); + logger.Debug(string.Format("WebClient({0}): Returning {1} => {2} bytes", ClientType, result.Status, (result.IsRedirect ? result.RedirectingTo + " " : "") + (result.Content == null ? "" : result.Content.Length.ToString()))); return result; } @@ -117,8 +117,8 @@ namespace Jackett.Common.Utils.Clients var stringResult = Mapper.Map(result); string decodedContent = null; - if (result.ContentBytes != null) - decodedContent = result.Encoding.GetString(result.ContentBytes); + if (result.Content != null) + decodedContent = result.Encoding.GetString(result.Content); 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 43d3c36c5..5a1aeb9d0 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.ContentBytes); + str.ContentString = encoding.GetString(be.Content); }); - cfg.CreateMap().ForMember(x => x.ContentBytes, opt => opt.Ignore()).AfterMap((str, be) => + cfg.CreateMap().ForMember(x => x.Content, opt => opt.Ignore()).AfterMap((str, be) => { if (!string.IsNullOrEmpty(str.ContentString)) { var encoding = str.Request.Encoding ?? Encoding.UTF8; - be.ContentBytes = encoding.GetBytes(str.ContentString); + be.Content = encoding.GetBytes(str.ContentString); } });