mirror of
https://github.com/Jackett/Jackett
synced 2025-03-10 14:14:25 +00:00
Use base class when not looking at content variable
This commit is contained in:
parent
d760350dc0
commit
4531a876eb
2 changed files with 4 additions and 16 deletions
|
@ -584,17 +584,7 @@ namespace Jackett.Common.Indexers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task FollowIfRedirect(WebClientStringResult response, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
protected async Task FollowIfRedirect(BaseWebResult response, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
||||||
{
|
|
||||||
var byteResult = new WebClientByteResult();
|
|
||||||
// Map to byte
|
|
||||||
Mapper.Map(response, byteResult);
|
|
||||||
await FollowIfRedirect(byteResult, referrer, overrideRedirectUrl, overrideCookies, accumulateCookies);
|
|
||||||
// Map to string
|
|
||||||
Mapper.Map(byteResult, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async Task FollowIfRedirect(WebClientByteResult response, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
|
||||||
{
|
{
|
||||||
// Follow up to 5 redirects
|
// Follow up to 5 redirects
|
||||||
for (var i = 0; i < 5; i++)
|
for (var i = 0; i < 5; i++)
|
||||||
|
@ -639,7 +629,7 @@ namespace Jackett.Common.Indexers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DoFollowIfRedirect(WebClientByteResult incomingResponse, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
private async Task DoFollowIfRedirect(BaseWebResult incomingResponse, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)
|
||||||
{
|
{
|
||||||
if (incomingResponse.IsRedirect)
|
if (incomingResponse.IsRedirect)
|
||||||
{
|
{
|
||||||
|
|
|
@ -782,9 +782,7 @@ namespace Jackett.Common.Indexers
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string getRedirectDomainHint(WebClientByteResult result) => getRedirectDomainHint(result.Request.Url, result.RedirectingTo);
|
protected string getRedirectDomainHint(BaseWebResult result) => getRedirectDomainHint(result.Request.Url, result.RedirectingTo);
|
||||||
|
|
||||||
protected string getRedirectDomainHint(WebClientStringResult result) => getRedirectDomainHint(result.Request.Url, result.RedirectingTo);
|
|
||||||
|
|
||||||
protected async Task<bool> TestLogin()
|
protected async Task<bool> TestLogin()
|
||||||
{
|
{
|
||||||
|
@ -828,7 +826,7 @@ namespace Jackett.Common.Indexers
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool CheckIfLoginIsNeeded(WebClientStringResult Result, IHtmlDocument document)
|
protected bool CheckIfLoginIsNeeded(BaseWebResult Result, IHtmlDocument document)
|
||||||
{
|
{
|
||||||
if (Result.IsRedirect)
|
if (Result.IsRedirect)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue