Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using System.Threading;
- using Botting;
- namespace ImageTyperz_Recaptchav2
- {
- class ImageTyperz
- {
- public string ituser, itpass, sitekey, siteurl, status, capname, capid, res;
- public int startwait, checkwait, maxwait, httpwait, errors;
- public double balmin, balance;
- public bool failed;
- public Thread balthread;
- public ImageTyperz(string ituser_, string itpass_, string sitekey_, string siteurl_,
- int maxwait_ = 90, int httpwait_ = 10, int checkwait_ = 3, int startwait_ = 10,
- double balmin_ = .05)
- {
- ituser = ituser_;
- itpass = itpass_;
- sitekey = sitekey_;
- siteurl = siteurl_;
- maxwait = maxwait_;
- httpwait = httpwait_;
- checkwait = checkwait_;
- startwait = startwait_;
- balmin = balmin_;
- status = "";
- capname = "";
- capid = "";
- res = "";
- errors = 0;
- balance = 0;
- failed = false;
- balthread = new Thread(GetBalance);
- balthread.Start();
- }
- public ImageTyperz(string ituser_, string itpass_, string capname_ = "captcha.jpg",
- int maxwait_ = 90, int httpwait_ = 6, int checkwait_ = 3, int startwait_ = 10,
- double balmin_ = .05)
- {
- ituser = ituser_;
- itpass = itpass_;
- capname = capname_;
- maxwait = maxwait_;
- httpwait = httpwait_;
- checkwait = checkwait_;
- startwait = startwait_;
- balmin = balmin_;
- status = "";
- capid = "";
- res = "";
- errors = 0;
- balance = 0;
- failed = false;
- balthread = new Thread(GetBalance);
- balthread.Start();
- }
- /*
- http://captchatypers.com/captchaapi/UploadRecaptchav1.ashx?action=UPLOADCAPTCHA&username=&password=&googlekey=&pageurl=
- 1234567890
- http://captchatypers.com/captchaapi/GetRecaptchaText.ashx?action=GETTEXT&username=&password=&Captchaid=
- 03Axxx...
- ERROR: NOT_DECODED
- ERROR: IMAGE_TIMED_OUT
- */
- public void SolveRecaptcha()
- {
- status = "Uploading Recaptcha captcha";
- capname = "";
- capid = "";
- res = "";
- failed = false;
- Http http = new Http();
- http.Accept = "*/*";
- http.Async = true;
- string url = "http://captchatypers.com/captchaapi/UploadRecaptchav1.ashx?" +
- "action=UPLOADCAPTCHA" +
- "&username=" + ituser +
- "&password=" + itpass +
- "&googlekey=" + sitekey +
- "&pageurl=" + WebUtility.UrlEncode(siteurl);
- http.HttpGet(url, (httpwait * 1000)).Trim();
- double wc = 0;
- while(http.Html == "" && !http.Failed)
- {
- wc++;
- if ((wc / 8) > httpwait)
- {
- errors++;
- failed = true;
- return;
- }
- status = "Uploading Recaptcha captcha (" + Math.Round((wc / 8), 0) + "/" +
- httpwait + ")";
- Thread.Sleep(125);
- }
- string html = http.Html.Trim();
- if (html.Contains("ERROR"))
- {
- errors++;
- failed = true;
- return;
- }
- long capidlong = 0;
- if (!long.TryParse(html, out capidlong))
- {
- errors++;
- failed = true;
- return;
- }
- capid = capidlong.ToString();
- status = "Solving Recaptcha captcha";
- double sc = 0;
- wc = 0;
- while(true)
- {
- sc++;
- if ((wc / 8) >= startwait && ((wc / 8) == startwait || (sc / 8) == checkwait))
- {
- sc = 0;
- http = new Http();
- http.Accept = "*/*";
- http.Async = true;
- url = "http://captchatypers.com/captchaapi/GetRecaptchaText.ashx?" +
- "action=GETTEXT" +
- "&username=" + ituser +
- "&password=" + itpass +
- "&Captchaid=" + capid.Trim();
- http.HttpGet(url, (httpwait * 1000));
- int hwc = 0;
- while (http.Html == "" && !http.Failed && (hwc / 8) < httpwait)
- {
- wc++;
- hwc++;
- if ((wc / 8) > maxwait)
- {
- ClaimBad();
- errors++;
- failed = true;
- return;
- }
- status = "Solving Recaptcha captcha (" + Math.Round((wc / 8), 0) + "/" +
- maxwait + ")";
- Thread.Sleep(125);
- }
- html = http.Html.Trim();
- if (html.Contains("ERROR") && !html.Contains("NOT_DECODED"))
- {
- ClaimBad();
- errors++;
- failed = true;
- return;
- }
- if (!html.Contains("ERROR") && html.Length > 50)
- {
- res = html;
- break;
- }
- }
- else
- {
- wc++;
- status = "Solving Recaptcha captcha (" + Math.Round((wc / 8), 0) + "/" +
- maxwait + ")";
- Thread.Sleep(125);
- }
- }
- balthread = new Thread(GetBalance);
- balthread.Start();
- errors = 0;
- }
- // http://captchatypers.com/Forms/SetBadImage.ashx?action=SETBADIMAGE&username=&password=imageid=
- public void ClaimBad()
- {
- if (capid == "") { return; }
- Http http = new Http();
- http.Accept = "*/*";
- http.Async = true;
- string url = "http://captchatypers.com/Forms/SetBadImage.ashx";
- string data = "action=SETBADIMAGE" +
- "&username=" + ituser +
- "&password=" + itpass +
- "&imageid=" + capid;
- http.HttpPost(url, data);
- }
- // http://www.captchatypers.com/Forms/RequestBalance.ashx?action=REQUESTBALANCE&username=&password=
- public void GetBalance()
- {
- Http http = new Http();
- http.Accept = "*/*";
- string url = "http://www.captchatypers.com/Forms/RequestBalance.ashx";
- string data = "action=REQUESTBALANCE" +
- "&username=" + ituser +
- "&password=" + itpass;
- string html = http.HttpPost(url, data);
- double baldbl = 0;
- if (double.TryParse(html, out baldbl)) { balance = baldbl; }
- }
- }
- }
Add Comment
Please, Sign In to add comment