mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
x264: upgrade to recaptcha V2
This commit is contained in:
@@ -56,13 +56,12 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||||
CQ dom = loginPage.Content;
|
CQ dom = loginPage.Content;
|
||||||
CQ recaptchaScript = dom.Find("script").First();
|
|
||||||
|
|
||||||
string recaptchaSiteKey = recaptchaScript.Attr("src").Split('=')[1];
|
|
||||||
var result = this.configData;
|
var result = this.configData;
|
||||||
|
var captcha = dom.Find(".g-recaptcha");
|
||||||
result.CookieHeader.Value = loginPage.Cookies;
|
result.CookieHeader.Value = loginPage.Cookies;
|
||||||
result.Captcha.SiteKey = recaptchaSiteKey;
|
result.Captcha.SiteKey = captcha.Attr("data-sitekey");
|
||||||
result.Captcha.Version = "1";
|
result.Captcha.Version = "2";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,8 +71,7 @@ namespace Jackett.Indexers
|
|||||||
var pairs = new Dictionary<string, string> {
|
var pairs = new Dictionary<string, string> {
|
||||||
{ "username", configData.Username.Value },
|
{ "username", configData.Username.Value },
|
||||||
{ "password", configData.Password.Value },
|
{ "password", configData.Password.Value },
|
||||||
{ "recaptcha_challenge_field", configData.Captcha.Challenge },
|
{ "g-recaptcha-response", configData.Captcha.Value }
|
||||||
{ "recaptcha_response_field", configData.Captcha.Value },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(configData.Captcha.Cookie))
|
if (!string.IsNullOrWhiteSpace(configData.Captcha.Cookie))
|
||||||
|
Reference in New Issue
Block a user