예제 #1
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);

            string recaptchaSiteKey = new Regex(@"loginwidget', \{[\s]{4,30}'sitekey' : '([0-9A-Za-z]{5,60})',[\s]{4,30}'theme'").Match(loginPage.Content).Groups[1].ToString().Trim();
            var    result           = new ConfigurationDataRecaptchaLogin();

            result.CookieHeader.Value = loginPage.Cookies;
            result.Captcha.SiteKey    = recaptchaSiteKey;
            return(result);
        }
예제 #2
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var loginPage = await RequestStringWithCookies(StartPageUrl, string.Empty);

            CQ  cq     = loginPage.Content;
            var result = new ConfigurationDataRecaptchaLogin();

            result.CookieHeader.Value = loginPage.Cookies;
            result.Captcha.SiteKey    = cq.Find(".g-recaptcha").Attr("data-sitekey");
            return(result);
        }
예제 #3
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);

            CQ dom             = loginPage.Content;
            CQ recaptchaScript = dom.Find("script").First();

            string recaptchaSiteKey = recaptchaScript.Attr("src").Split('=')[1];
            var    result           = new ConfigurationDataRecaptchaLogin();

            result.CookieHeader.Value = loginPage.Cookies;
            result.Captcha.SiteKey    = recaptchaSiteKey;
            result.Captcha.Version    = "1";
            return(result);
        }
예제 #4
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var loginPage = await RequestStringWithCookies(StartPageUrl, string.Empty);

            CQ  cq        = loginPage.Content;
            var result    = new ConfigurationDataRecaptchaLogin();
            CQ  recaptcha = cq.Find(".g-recaptcha").Attr("data-sitekey");

            if (recaptcha.Length != 0)   // recaptcha not always present in login form, perhaps based on cloudflare uid or just phase of the moon
            {
                result.CookieHeader.Value = loginPage.Cookies;
                result.Captcha.SiteKey    = cq.Find(".g-recaptcha").Attr("data-sitekey");
                return(result);
            }
            else
            {
                var stdResult = new ConfigurationDataBasicLogin();
                stdResult.CookieHeader.Value = loginPage.Cookies;
                return(stdResult);
            }
        }