New: Support for indexers with image CAPTCHAs

This commit is contained in:
ta264
2021-03-17 21:30:11 +00:00
committed by Qstick
parent 95d5e0d347
commit 0fa526a1af
15 changed files with 314 additions and 159 deletions

View File

@@ -18,7 +18,6 @@ namespace NzbDrone.Core.Indexers.Cardigann
public class CardigannBase
{
protected readonly CardigannDefinition _definition;
protected readonly CardigannSettings _settings;
protected readonly Logger _logger;
protected readonly Encoding _encoding;
protected readonly IConfigService _configService;
@@ -48,14 +47,14 @@ namespace NzbDrone.Core.Indexers.Cardigann
protected static readonly Regex _LogicFunctionRegex = new Regex(
$@"\b({string.Join("|", _SupportedLogicFunctions.Select(Regex.Escape))})(?:\s+(\(?\.[^\)\s]+\)?|""[^""]+"")){{2,}}");
public CardigannSettings Settings { get; set; }
public CardigannBase(IConfigService configService,
CardigannDefinition definition,
CardigannSettings settings,
Logger logger)
{
_configService = configService;
_definition = definition;
_settings = settings;
_encoding = Encoding.GetEncoding(definition.Encoding);
_logger = logger;
@@ -224,7 +223,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
foreach (var setting in _definition.Settings)
{
var name = ".Config." + setting.Name;
var value = _settings.ExtraFieldData.GetValueOrDefault(setting.Name, setting.Default);
var value = Settings.ExtraFieldData.GetValueOrDefault(setting.Name, setting.Default);
if (setting.Type != "password" && indexerLogging)
{
@@ -260,6 +259,9 @@ namespace NzbDrone.Core.Indexers.Cardigann
{
variables[name] = value;
}
else if (setting.Type == "cardigannCaptcha")
{
}
else
{
throw new NotSupportedException();