mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-18 19:15:10 -04:00
New: (Cardigann) Add login.test.contains
This commit is contained in:
parent
8bd6a313b7
commit
d4fd7720c7
3 changed files with 13 additions and 2 deletions
|
@ -28,8 +28,8 @@ namespace NzbDrone.Core.IndexerVersions
|
|||
{
|
||||
/* Update Service will fall back if version # does not exist for an indexer per Ta */
|
||||
|
||||
private const string DEFINITION_BRANCH = "master";
|
||||
private const int DEFINITION_VERSION = 9;
|
||||
private const string DEFINITION_BRANCH = "cardigann-contains";
|
||||
private const int DEFINITION_VERSION = 10;
|
||||
|
||||
// Used when moving yml to C#
|
||||
private readonly List<string> _definitionBlocklist = new ()
|
||||
|
|
|
@ -134,6 +134,7 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
|||
{
|
||||
public string Path { get; set; }
|
||||
public string Selector { get; set; }
|
||||
public string Contains { get; set; }
|
||||
}
|
||||
|
||||
public class RatioBlock : SelectorBlock
|
||||
|
|
|
@ -1028,6 +1028,16 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
|||
return true;
|
||||
}
|
||||
|
||||
if (_definition.Login.Test?.Contains != null && _definition.Login.Test.Contains.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
if (_definition.Login.Test.Contains[0] == '!')
|
||||
{
|
||||
return response.Content.Contains(_definition.Login.Test.Contains[1..]);
|
||||
}
|
||||
|
||||
return !response.Content.Contains(_definition.Login.Test.Contains);
|
||||
}
|
||||
|
||||
// Only run html test selector on html responses
|
||||
if (_definition.Login.Test?.Selector != null && (response.Headers.ContentType?.Contains("text/html") ?? true))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue