core: refactor http webclient part 1 #8529 (#7652)

Rename WebClientStringResult.Content to WebClientStringResult.ContentString
This commit is contained in:
Cory
2020-06-09 19:36:57 +02:00
committed by ngosang
parent cf34dfec8e
commit d760350dc0
90 changed files with 380 additions and 380 deletions

View File

@@ -87,11 +87,11 @@ namespace Jackett.Common.Indexers
// Send Post
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: LoginUrl);
await ConfigureIfOK(response.Cookies, response.Content?.Contains("logout.php") == true, () =>
await ConfigureIfOK(response.Cookies, response.ContentString?.Contains("logout.php") == true, () =>
{
var errorStr = "You have {0} remaining login attempts";
var remainingAttemptSpan = new Regex(string.Format(errorStr, "(.*?)"))
.Match(loginPage.Content).Groups[1].ToString();
.Match(loginPage.ContentString).Groups[1].ToString();
var attempts = Regex.Replace(remainingAttemptSpan, "<.*?>", string.Empty);
var errorMessage = string.Format(errorStr, attempts);
throw new ExceptionWithConfigData(errorMessage, configData);
@@ -124,7 +124,7 @@ namespace Jackett.Common.Indexers
try
{
var resultParser = new HtmlParser();
var searchResultDocument = resultParser.ParseDocument(response.Content);
var searchResultDocument = resultParser.ParseDocument(response.ContentString);
var rows = searchResultDocument.QuerySelectorAll("table.lista > tbody > tr");
foreach (var row in rows)
@@ -177,7 +177,7 @@ namespace Jackett.Common.Indexers
}
catch (Exception ex)
{
OnParseError(response.Content, ex);
OnParseError(response.ContentString, ex);
}
return releases;