x264: upgrade to recaptcha V2

This commit is contained in:
kaso17 2017-01-02 21:45:15 +01:00
parent f99e104755
commit 20b9b692f0
1 changed files with 4 additions and 6 deletions

View File

@ -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))