mirror of https://github.com/Jackett/Jackett
Cardigann: automatically solve simpleCaptchas (#710)
This commit is contained in:
parent
3aecc53b5f
commit
5a4c1282ef
|
@ -371,6 +371,18 @@ namespace Jackett.Indexers
|
|||
pairs[Input.Key] = value;
|
||||
}
|
||||
|
||||
// automatically solve simpleCaptchas, if used
|
||||
var simpleCaptchaPresent = landingResultDocument.QuerySelector("script[src*=\"simpleCaptcha\"]");
|
||||
if(simpleCaptchaPresent != null)
|
||||
{
|
||||
var captchaUrl = resolvePath("simpleCaptcha.php?numImages=1");
|
||||
var simpleCaptchaResult = await RequestStringWithCookies(captchaUrl.ToString(), landingResult.Cookies, LoginUrl);
|
||||
var simpleCaptchaJSON = JObject.Parse(simpleCaptchaResult.Content);
|
||||
var captchaSelection = simpleCaptchaJSON["images"][0]["hash"].ToString();
|
||||
pairs["captchaSelection"] = captchaSelection;
|
||||
pairs["submitme"] = "X";
|
||||
}
|
||||
|
||||
var loginResult = await RequestLoginAndFollowRedirect(submitUrl.ToString(), pairs, landingResult.Cookies, true, null, SiteLink, true);
|
||||
configData.CookieHeader.Value = loginResult.Cookies;
|
||||
|
||||
|
|
Loading…
Reference in New Issue