mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Cardigann: Add support for selector inputs
This commit is contained in:
@@ -80,6 +80,7 @@ namespace Jackett.Indexers
|
|||||||
public string Form { get; set; }
|
public string Form { get; set; }
|
||||||
public bool Selectors { get; set; } = false;
|
public bool Selectors { get; set; } = false;
|
||||||
public Dictionary<string, string> Inputs { get; set; }
|
public Dictionary<string, string> Inputs { get; set; }
|
||||||
|
public Dictionary<string, selectorBlock> Selectorinputs { get; set; }
|
||||||
public List<errorBlock> Error { get; set; }
|
public List<errorBlock> Error { get; set; }
|
||||||
public pageTestBlock Test { get; set; }
|
public pageTestBlock Test { get; set; }
|
||||||
public captchaBlock Captcha { get; set; }
|
public captchaBlock Captcha { get; set; }
|
||||||
@@ -472,6 +473,21 @@ namespace Jackett.Indexers
|
|||||||
pairs[input] = value;
|
pairs[input] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// selector inputs
|
||||||
|
foreach (var Selectorinput in Login.Selectorinputs)
|
||||||
|
{
|
||||||
|
string value = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
value = handleSelector(Selectorinput.Value, landingResultDocument.FirstElementChild);
|
||||||
|
pairs[Selectorinput.Key] = value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(string.Format("Error while parsing selector input={0}, selector={1}, value={2}: {3}", Selectorinput.Key, Selectorinput.Value.Selector, value, ex.Message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// automatically solve simpleCaptchas, if used
|
// automatically solve simpleCaptchas, if used
|
||||||
var simpleCaptchaPresent = landingResultDocument.QuerySelector("script[src*=\"simpleCaptcha\"]");
|
var simpleCaptchaPresent = landingResultDocument.QuerySelector("script[src*=\"simpleCaptcha\"]");
|
||||||
if(simpleCaptchaPresent != null)
|
if(simpleCaptchaPresent != null)
|
||||||
|
Reference in New Issue
Block a user