mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 05:47:22 -04: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 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||
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…
Add table
Add a link
Reference in a new issue