mirror of https://github.com/Jackett/Jackett
improve cardigann's need-cookie-for-recaptcha checking. resolves #5963
This commit is contained in:
parent
31e781588d
commit
971f464f90
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue