improve cardigann's need-cookie-for-recaptcha checking. resolves #5963

This commit is contained in:
Garfield69 2019-10-02 20:31:18 +13:00
parent 31e781588d
commit 971f464f90
1 changed files with 10 additions and 2 deletions

View File

@ -788,9 +788,17 @@ namespace Jackett.Common.Indexers
var hasCaptcha = false;
var CloudFlareCaptchaChallenge = landingResultDocument.QuerySelector("script[src*=\"/recaptcha/api.js\"]");
var cloudFlareCaptchaScript = landingResultDocument.QuerySelector("script[src*=\"/recaptcha/api.js\"]");
var cloudFlareCaptchaGroup = landingResultDocument.QuerySelector("#recaptca_group");
var cloudFlareCaptchaDisplay = true;
if (cloudFlareCaptchaGroup != null)
{
var cloudFlareCaptchaGroupStyle = cloudFlareCaptchaGroup.GetAttribute("style");
if (cloudFlareCaptchaGroupStyle != null)
cloudFlareCaptchaDisplay = !cloudFlareCaptchaGroupStyle.Contains("display:none;");
}
var grecaptcha = landingResultDocument.QuerySelector(".g-recaptcha");
if (CloudFlareCaptchaChallenge != null && grecaptcha != null)
if (cloudFlareCaptchaScript != null && grecaptcha != null && cloudFlareCaptchaDisplay)
{
hasCaptcha = true;
var CaptchaItem = new RecaptchaItem();