Example #1
0
        public static void run()
        {
            // get access token from: http://www.imagetyperz.com
            string         token = Config.TOKEN;
            ImageTypersAPI i     = new ImageTypersAPI(token);

            // balance
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("page_url", "https://your-site.com");
            d.Add("sitekey", "Fme6hZLjuCRMMC3uh15F52D3uNms5c");
            //d.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            //d.Add("user_agent", "Your user agent"); // optional

            string captcha_id = i.submit_capy(d);

            Console.WriteLine("Waiting for captcha to be solved...");
            Dictionary <string, string> response = null;

            while (response == null)
            {
                System.Threading.Thread.Sleep(10000);       // sleep for 10 secons before checking for response
                response = i.retrieve_response(captcha_id);
            }
            ImageTypers.Utils.print_response(response);
        }
Example #2
0
        public static void run()
        {
            // get access token from: http://www.imagetyperz.com
            string         token = Config.TOKEN;
            ImageTypersAPI i     = new ImageTypersAPI(token);

            // balance
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            // optional parameters dict
            Dictionary <string, string> image_params = new Dictionary <string, string>();

            //image_params.Add("iscase", "true");         // case sensitive captcha
            //image_params.Add("isphrase", "true");       // text contains at least one space (phrase)
            //image_params.Add("ismath", "true");         // instructs worker that a math captcha has to be solved
            //image_params.Add("alphanumeric", "1");      // 1 - digits only, 2 - letters only
            //image_params.Add("minlength", "2");         // captcha text length (minimum)
            //image_params.Add("maxlength", "5");         // captcha text length (maximum)

            Console.WriteLine("Waiting for captcha to be solved...");
            string captcha_id = i.submit_image("captcha.jpg", image_params);
            Dictionary <string, string> response = i.retrieve_response(captcha_id);

            ImageTypers.Utils.print_response(response);
        }
        public static void run()
        {
            // get access token from: http://www.imagetyperz.com
            string         token = Config.TOKEN;
            ImageTypersAPI i     = new ImageTypersAPI(token);

            // balance
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("domain", "https://your-site.com");
            d.Add("challenge", "eea8d7d1bd1a933d72a9eda8af6d15d3");
            d.Add("gt", "1a761081b1114c388092c8e2fd7f58bc");
            //d.Add("api_server", "api.geetest.com"); // optional
            //d.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            //d.Add("user_agent", "Your user agent"); // optional

            string captcha_id = i.submit_geetest(d);

            Console.WriteLine("Waiting for captcha to be solved...");
            Dictionary <string, string> response = null;

            while (response == null)
            {
                System.Threading.Thread.Sleep(10000);       // sleep for 10 secons before checking for response
                response = i.retrieve_response(captcha_id);
            }
            ImageTypers.Utils.print_response(response);
        }
Example #4
0
        public static void run()
        {
            // get access token from: http://www.imagetyperz.com
            string         token = Config.TOKEN;
            ImageTypersAPI i     = new ImageTypersAPI(token);

            // balance
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("page_url", "https://tiktok.com");
            // make sure `s_v_web_id` cookie is present
            d.Add("cookie_input", "s_v_web_id:verify_kd6243o_fd449FX_FDGG_1x8E_8NiQ_fgrg9FEIJ3f;tt_webid:612465623570154;tt_webid_v2:7679206562717014313;SLARDAR_WEB_ID:d0314f-ce16-5e16-a066-71f19df1545f;");
            //d.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            //d.Add("user_agent", "Your user agent"); // optional

            string captcha_id = i.submit_tiktok(d);

            Console.WriteLine("Waiting for captcha to be solved...");
            Dictionary <string, string> response = null;

            while (response == null)
            {
                System.Threading.Thread.Sleep(10000);       // sleep for 10 secons before checking for response
                response = i.retrieve_response(captcha_id);
            }
            ImageTypers.Utils.print_response(response);
        }
Example #5
0
        public static void run()
        {
            // get access token from: http://www.imagetyperz.com
            string         token = Config.TOKEN;
            ImageTypersAPI i     = new ImageTypersAPI(token);

            // balance
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("page_url", "https://your-site.com");
            d.Add("sitekey", "7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL");
            // reCAPTCHA type(s) - optional, defaults to 1
            // ---------------------------------------------
            // 1 - v2
            // 2 - invisible
            // 3 - v3
            // 4 - enterprise v2
            // 5 - enterprise v3
            //
            // d.Add("type", "1");                 // optional
            //
            //d.Add("v3_min_score", "0.1");       // optional
            //d.Add("v3_action", "homepage");     // optional
            //d.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            //d.Add("user_agent", "Your user agent"); // optional
            //d.Add("data-s", "recaptcha data-s value"); // optional
            //d.Add("cookie_input", "a=b;c=d"); // optional

            string captcha_id = i.submit_recaptcha(d);

            Console.WriteLine("Waiting for captcha to be solved...");
            Dictionary <string, string> response = null;

            while (response == null)
            {
                System.Threading.Thread.Sleep(10000);       // sleep for 10 secons before checking for response
                response = i.retrieve_response(captcha_id);
            }
            ImageTypers.Utils.print_response(response);

            // other examples
            // ImagetypersAPI i = new ImagetypersAPI(username, password, 123);     // init with affiliate id
            // i.set_timeout(10);                                                  // set timeout to 10 seconds
            // Console.WriteLine(i.set_captcha_bad(captcha_id));                   // if response is incorrect, set captcha as bad using ID
        }
        /// <summary>
        /// Private _run method
        /// </summary>
        private void _run()
        {
            var a = this._arguments;        // for easier use local

            ImageTypersAPI i;
            var            token = a.get_token();

            if (string.IsNullOrWhiteSpace(token))
            {
                throw new Exception("token is missing");
            }
            i = new ImageTypersAPI(token);
            switch (a.get_mode())
            {
            case "get_balance":
                string balance = i.account_balance();
                this.show_output(balance);          // show balance
                break;

            case "submit_image":
                // solve normal captcha
                string captcha_file = a.get_captcha_file();
                if (string.IsNullOrWhiteSpace(captcha_file))
                {
                    throw new Exception("Invalid captcha file");
                }
                // optional params
                Dictionary <string, string> id = new Dictionary <string, string>();

                // optional
                if (a.is_case_sensitive())
                {
                    id.Add("iscase", "true");
                }
                if (a.get_is_phrase())
                {
                    id.Add("isphrase", "true");
                }
                if (a.get_is_math())
                {
                    id.Add("ismath", "true");
                }
                if (a.get_alpha_numeric() != -1)
                {
                    id.Add("alphanumeric", a.get_alpha_numeric().ToString());
                }
                if (a.get_min_length() != -1)
                {
                    id.Add("minlength", a.get_min_length().ToString());
                }
                if (a.get_max_length() != -1)
                {
                    id.Add("maxlength", a.get_max_length().ToString());
                }

                string captcha_id = i.submit_image(captcha_file, id);
                this.show_output(captcha_id);
                break;

            case "submit_recaptcha":
                string page_url = a.get_page_url();
                string site_key = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_url))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_key))
                {
                    throw new Exception("Invalid sitekey");
                }

                Dictionary <string, string> d = new Dictionary <string, string>();
                d.Add("page_url", page_url);
                d.Add("sitekey", site_key);

                // optional
                if (!string.IsNullOrWhiteSpace(a.get_type()))
                {
                    d.Add("type", a.get_type());
                }
                if (!string.IsNullOrWhiteSpace(a.get_v3_action()))
                {
                    d.Add("v3_action", a.get_v3_action());
                }
                if (!string.IsNullOrWhiteSpace(a.get_v3_score()))
                {
                    d.Add("v3_min_score", a.get_v3_score());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    d.Add("user_agent", a.get_user_agent());
                }
                if (!string.IsNullOrWhiteSpace(a.get_datas()))
                {
                    d.Add("data-s", a.get_datas());
                }
                if (!string.IsNullOrWhiteSpace(a.get_cookie_input()))
                {
                    d.Add("cookie_input", a.get_cookie_input());
                }
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    d.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    d.Add("user_agent", a.get_user_agent());
                }
                string cid = i.submit_recaptcha(d);
                this.show_output(cid);
                break;

            case "submit_hcaptcha":
                string page_urlh = a.get_page_url();
                string site_keyh = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_urlh))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_keyh))
                {
                    throw new Exception("Invalid sitekey");
                }
                Dictionary <string, string> dh = new Dictionary <string, string>();
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dh.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dh.Add("user_agent", a.get_user_agent());
                }
                if (a.get_invisible_hcaptcha())
                {
                    dh.Add("invisible", "1");
                }
                dh.Add("page_url", page_urlh);
                dh.Add("sitekey", site_keyh);
                string hcaptcha_id_sub = i.submit_hcaptcha(dh);
                this.show_output(hcaptcha_id_sub);
                break;

            case "submit_capy":
                string page_urlc = a.get_page_url();
                string site_keyc = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_urlc))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_keyc))
                {
                    throw new Exception("Invalid sitekey");
                }

                Dictionary <string, string> dc = new Dictionary <string, string>();
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dc.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dc.Add("user_agent", a.get_user_agent());
                }
                dc.Add("page_url", page_urlc);
                dc.Add("sitekey", site_keyc);
                string capy_id_sub = i.submit_capy(dc);
                this.show_output(capy_id_sub);
                break;

            case "submit_geetest":
                string gt_domain    = a.get_gt_domain();
                string gt_challenge = a.get_gt_challenge();
                string gt_gt        = a.get_gt_gt();
                if (string.IsNullOrWhiteSpace(gt_domain))
                {
                    throw new Exception("Invalid domain");
                }
                if (string.IsNullOrWhiteSpace(gt_challenge))
                {
                    throw new Exception("Invalid challenge");
                }
                if (string.IsNullOrWhiteSpace(gt_gt))
                {
                    throw new Exception("Invalid gt");
                }

                Dictionary <string, string> dg = new Dictionary <string, string>();
                dg.Add("domain", gt_domain);
                dg.Add("challenge", gt_challenge);
                dg.Add("gt", gt_gt);

                // optional
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dg.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dg.Add("user_agent", a.get_user_agent());
                }
                string geetest_id_sub = i.submit_geetest(dg);
                this.show_output(geetest_id_sub);
                break;

            case "submit_geetest_v4":
                string gt_v4_domain    = a.get_gt_domain();
                string gt_v4_geetestid = a.get_gt_geetestid();
                if (string.IsNullOrWhiteSpace(gt_v4_domain))
                {
                    throw new Exception("Invalid domain");
                }
                if (string.IsNullOrWhiteSpace(gt_v4_geetestid))
                {
                    throw new Exception("Invalid geetestid");
                }

                Dictionary <string, string> dg4 = new Dictionary <string, string>();
                dg4.Add("domain", gt_v4_domain);
                dg4.Add("geetestid", gt_v4_geetestid);

                // optional
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dg4.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dg4.Add("user_agent", a.get_user_agent());
                }
                string geetest_v4_id_sub = i.submit_geetest_v4(dg4);
                this.show_output(geetest_v4_id_sub);
                break;

            case "submit_tiktok":
                string page_urlt    = a.get_page_url();
                string cookie_input = a.get_cookie_input();
                if (string.IsNullOrWhiteSpace(page_urlt))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(cookie_input))
                {
                    throw new Exception("Invalid cookie_input");
                }

                Dictionary <string, string> dcc = new Dictionary <string, string>();
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dcc.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dcc.Add("user_agent", a.get_user_agent());
                }
                dcc.Add("page_url", page_urlt);
                dcc.Add("cookie_input", cookie_input);
                string tiktok_id = i.submit_tiktok(dcc);
                this.show_output(tiktok_id);
                break;

            case "submit_funcaptcha":
                string page_urlfc = a.get_page_url();
                string site_keyfc = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_urlfc))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_keyfc))
                {
                    throw new Exception("Invalid sitekey");
                }
                Dictionary <string, string> dcf = new Dictionary <string, string>();
                dcf.Add("page_url", page_urlfc);
                dcf.Add("sitekey", site_keyfc);

                // others
                if (!string.IsNullOrWhiteSpace(a.get_s_url()))
                {
                    dcf.Add("s_url", a.get_s_url());
                }
                if (!string.IsNullOrWhiteSpace(a.get_data()))
                {
                    dcf.Add("data", a.get_data());
                }
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dcf.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dcf.Add("user_agent", a.get_user_agent());
                }
                string funcaptcha_id = i.submit_funcaptcha(dcf);
                this.show_output(funcaptcha_id);
                break;

            case "retrieve_response":
                string kid = a.get_captcha_id();
                if (string.IsNullOrWhiteSpace(kid))
                {
                    throw new Exception("id is invalid");
                }
                var recaptcha_response = i.retrieve_response(kid); // get recaptcha response
                this.show_output(recaptcha_response);              // show response
                break;

            case "set_captcha_bad":
                string bad_id = a.get_captcha_id();
                if (string.IsNullOrWhiteSpace(bad_id))
                {
                    throw new Exception("id is invalid");
                }
                string response = i.set_captcha_bad(bad_id); // set it bad
                this.show_output(response);                  // show response
                break;

            default:
                throw new Exception("invalid mode");
            }
        }