Cardigann: add check for redirect when pulling login page (#9984)

This commit is contained in:
Alexandre Beloin 2020-10-27 17:00:18 -04:00 committed by GitHub
parent aec14b88e9
commit 4b743e4040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -880,6 +880,12 @@ namespace Jackett.Common.Indexers
configData.CookieHeader.Value = string.Join("; ", Login.Cookies);
landingResult = await RequestWithCookiesAsync(LoginUrl.AbsoluteUri, referer: SiteLink);
// Some sites have a temporary redirect before the login page, we need to process it.
if (Definition.Followredirect)
{
await FollowIfRedirect(landingResult, LoginUrl.AbsoluteUri, overrideCookies: landingResult.Cookies, accumulateCookies: true);
}
var htmlParser = new HtmlParser();
landingResultDocument = htmlParser.ParseDocument(landingResult.ContentString);