mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-19 19:30:47 +02:00
Fixed: (Cardigann) Don't try re-auth if can't html parse json
This commit is contained in:
parent
a31971472d
commit
470b751f44
1 changed files with 11 additions and 7 deletions
|
|
@ -924,15 +924,19 @@ public bool CheckIfLoginIsNeeded(HttpResponse response)
|
|||
return true;
|
||||
}
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(response.Content);
|
||||
|
||||
if (_definition.Login.Test.Selector != null)
|
||||
// Only run html test selector on html responses
|
||||
if (response.Headers.ContentType.Contains("text/html"))
|
||||
{
|
||||
var selection = document.QuerySelectorAll(_definition.Login.Test.Selector);
|
||||
if (selection.Length == 0)
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(response.Content);
|
||||
|
||||
if (_definition.Login.Test.Selector != null)
|
||||
{
|
||||
return true;
|
||||
var selection = document.QuerySelectorAll(_definition.Login.Test.Selector);
|
||||
if (selection.Length == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue