mirror of
https://github.com/Jackett/Jackett
synced 2025-01-01 04:38:20 +00:00
I can't test this very well because I always get the callenge in all domains. With this fix the configuration dialog will open at least.
This commit is contained in:
parent
1c34303f58
commit
4f9670413d
1 changed files with 10 additions and 8 deletions
|
@ -132,7 +132,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
//result.CookieHeader.Value = loginPage.Cookies;
|
||||
UpdateCookieHeader(loginPage.Cookies); // update cookies instead of replacing them, see #3717
|
||||
result.Captcha.SiteKey = dom.QuerySelector(".g-recaptcha").GetAttribute("data-sitekey");
|
||||
result.Captcha.SiteKey = dom.QuerySelector(".g-recaptcha")?.GetAttribute("data-sitekey");
|
||||
result.Captcha.Version = "2";
|
||||
return result;
|
||||
}
|
||||
|
@ -168,17 +168,19 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, configData.CookieHeader.Value, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var errorMessage = result.Content;
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var messageEl = dom.QuerySelector("#login");
|
||||
foreach (var child in messageEl.QuerySelectorAll("form"))
|
||||
child.Remove();
|
||||
var errorMessage = messageEl.TextContent.Trim();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(errorMessage))
|
||||
errorMessage = dom.TextContent;
|
||||
if (messageEl != null)
|
||||
{
|
||||
foreach (var child in messageEl.QuerySelectorAll("form"))
|
||||
child.Remove();
|
||||
errorMessage = messageEl.TextContent.Trim();
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(errorMessage) && result.IsRedirect)
|
||||
errorMessage = $"Got a redirect to {result.RedirectingTo}, please adjust your the alternative link";
|
||||
|
|
Loading…
Reference in a new issue