mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
DigitalHive: Captcha is optional now
This commit is contained in:
@@ -94,11 +94,24 @@ namespace Jackett.Indexers
|
|||||||
var loginPage = await RequestStringWithCookies(LoginUrl, configData.CookieHeader.Value);
|
var loginPage = await RequestStringWithCookies(LoginUrl, configData.CookieHeader.Value);
|
||||||
CQ cq = loginPage.Content;
|
CQ cq = loginPage.Content;
|
||||||
string recaptchaSiteKey = cq.Find(".g-recaptcha").Attr("data-sitekey");
|
string recaptchaSiteKey = cq.Find(".g-recaptcha").Attr("data-sitekey");
|
||||||
var result = this.configData;
|
if (recaptchaSiteKey != null)
|
||||||
result.CookieHeader.Value = loginPage.Cookies;
|
{
|
||||||
result.Captcha.SiteKey = recaptchaSiteKey;
|
var result = this.configData;
|
||||||
result.Captcha.Version = "2";
|
result.CookieHeader.Value = loginPage.Cookies;
|
||||||
return result;
|
result.Captcha.SiteKey = recaptchaSiteKey;
|
||||||
|
result.Captcha.Version = "2";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = new ConfigurationDataBasicLogin();
|
||||||
|
result.SiteLink.Value = configData.SiteLink.Value;
|
||||||
|
result.Instructions.Value = configData.Instructions.Value;
|
||||||
|
result.Username.Value = configData.Username.Value;
|
||||||
|
result.Password.Value = configData.Password.Value;
|
||||||
|
result.CookieHeader.Value = loginPage.Cookies;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||||
|
Reference in New Issue
Block a user