public ConfigurationDataRecaptchaLogin(string instructionMessageOptional = null)
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     Captcha = new RecaptchaItem() { Name = "Recaptcha" };
     Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
 }
 public ConfigurationDataRecaptchaLogin()
 {
     Username = new StringItem {
         Name = "Username"
     };
     Password = new StringItem {
         Name = "Password"
     };
     Captcha = new RecaptchaItem()
     {
         Name = "Recaptcha"
     };
 }
 public ConfigurationDataRecaptchaLogin(string instructionMessageOptional = null)
 {
     Username = new StringItem {
         Name = "Username"
     };
     Password = new StringItem {
         Name = "Password"
     };
     Captcha = new RecaptchaItem()
     {
         Name = "Recaptcha"
     };
     Instructions = new DisplayItem(instructionMessageOptional)
     {
         Name = ""
     };
 }
Пример #4
0
 public ConfigurationDataSceneTime()
     : base()
 {
     Username = new StringItem {
         Name = "Username"
     };
     Password = new StringItem {
         Name = "Password"
     };
     Captcha = new RecaptchaItem()
     {
         Name = "Recaptcha"
     };
     Freeleech = new BoolItem()
     {
         Name = "Freeleech Only (Optional)", Value = false
     };
     Instructions = new DisplayItem("For best results, change the 'Torrents per page' setting to the maximum in your profile on the SceneTime webpage.")
     {
         Name = ""
     };
 }
Пример #5
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var Login = Definition.Login;

            if (Login == null || Login.Method != "form")
            {
                return(configData);
            }

            var LoginUrl = SiteLink + Login.Path;

            configData.CookieHeader.Value = null;
            landingResult = await RequestStringWithCookies(LoginUrl, null, SiteLink);

            var htmlParser = new HtmlParser();

            landingResultDocument = htmlParser.Parse(landingResult.Content);

            var grecaptcha = landingResultDocument.QuerySelector(".g-recaptcha");

            if (grecaptcha != null)
            {
                var CaptchaItem = new RecaptchaItem();
                CaptchaItem.Name    = "Captcha";
                CaptchaItem.Version = "2";
                CaptchaItem.SiteKey = grecaptcha.GetAttribute("data-sitekey");
                if (CaptchaItem.SiteKey == null) // some sites don't store the sitekey in the .g-recaptcha div (e.g. cloudflare captcha challenge page)
                {
                    CaptchaItem.SiteKey = landingResultDocument.QuerySelector("[data-sitekey]").GetAttribute("data-sitekey");
                }

                configData.AddDynamic("Captcha", CaptchaItem);
            }

            return(configData);
        }
Пример #6
0
        public override async Task<ConfigurationData> GetConfigurationForSetup()
        {
            var Login = Definition.Login;

            if (Login == null || Login.Method != "form")
                return configData;

            var LoginUrl = SiteLink + Login.Path;

            configData.CookieHeader.Value = null;
            landingResult = await RequestStringWithCookies(LoginUrl, null, SiteLink);

            var htmlParser = new HtmlParser();
            landingResultDocument = htmlParser.Parse(landingResult.Content);

            var grecaptcha = landingResultDocument.QuerySelector(".g-recaptcha");
            if (grecaptcha != null)
            {
                var CaptchaItem = new RecaptchaItem();
                CaptchaItem.Name = "Captcha";
                CaptchaItem.Version = "2";
                CaptchaItem.SiteKey = grecaptcha.GetAttribute("data-sitekey");
                if (CaptchaItem.SiteKey == null) // some sites don't store the sitekey in the .g-recaptcha div (e.g. cloudflare captcha challenge page)
                    CaptchaItem.SiteKey = landingResultDocument.QuerySelector("[data-sitekey]").GetAttribute("data-sitekey");

                configData.AddDynamic("Captcha", CaptchaItem);
            }

            return configData;
        }
 public ConfigurationDataRecaptchaLogin()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     Captcha = new RecaptchaItem() { Name = "Recaptcha" };
 }