Yidir

Untitled

Jul 31st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. using System.Net;
  8. using System.Threading;
  9.  
  10. using Botting;
  11.  
  12.  
  13. namespace ImageTyperz_Recaptchav2
  14. {
  15.     class ImageTyperz
  16.     {
  17.         public string ituser, itpass, sitekey, siteurl, status, capname, capid, res;
  18.         public int startwait, checkwait, maxwait, httpwait, errors;
  19.         public double balmin, balance;
  20.         public bool failed;
  21.         public Thread balthread;
  22.  
  23.  
  24.         public ImageTyperz(string ituser_, string itpass_, string sitekey_, string siteurl_,
  25.           int maxwait_ = 90, int httpwait_ = 10, int checkwait_ = 3, int startwait_ = 10,
  26.           double balmin_ = .05)
  27.         {
  28.             ituser = ituser_;
  29.             itpass = itpass_;
  30.             sitekey = sitekey_;
  31.             siteurl = siteurl_;
  32.  
  33.             maxwait = maxwait_;
  34.             httpwait = httpwait_;
  35.             checkwait = checkwait_;
  36.             startwait = startwait_;
  37.             balmin = balmin_;
  38.  
  39.             status = "";
  40.             capname = "";
  41.             capid = "";
  42.             res = "";
  43.             errors = 0;
  44.             balance = 0;
  45.             failed = false;
  46.  
  47.             balthread = new Thread(GetBalance);
  48.             balthread.Start();
  49.         }
  50.  
  51.  
  52.         public ImageTyperz(string ituser_, string itpass_, string capname_ = "captcha.jpg",
  53.           int maxwait_ = 90, int httpwait_ = 6, int checkwait_ = 3, int startwait_ = 10,
  54.           double balmin_ = .05)
  55.         {
  56.             ituser = ituser_;
  57.             itpass = itpass_;
  58.             capname = capname_;
  59.  
  60.             maxwait = maxwait_;
  61.             httpwait = httpwait_;
  62.             checkwait = checkwait_;
  63.             startwait = startwait_;
  64.             balmin = balmin_;
  65.  
  66.             status = "";
  67.             capid = "";
  68.             res = "";
  69.             errors = 0;
  70.             balance = 0;
  71.             failed = false;
  72.  
  73.             balthread = new Thread(GetBalance);
  74.             balthread.Start();
  75.         }
  76.  
  77.  
  78.         /*
  79.             http://captchatypers.com/captchaapi/UploadRecaptchav1.ashx?action=UPLOADCAPTCHA&username=&password=&googlekey=&pageurl=
  80.             1234567890
  81.            
  82.             http://captchatypers.com/captchaapi/GetRecaptchaText.ashx?action=GETTEXT&username=&password=&Captchaid=
  83.             03Axxx...
  84.        
  85.             ERROR: NOT_DECODED
  86.             ERROR: IMAGE_TIMED_OUT        
  87.          */
  88.         public void SolveRecaptcha()
  89.         {
  90.             status = "Uploading Recaptcha captcha";
  91.             capname = "";
  92.             capid = "";
  93.             res = "";
  94.             failed = false;
  95.  
  96.             Http http = new Http();
  97.             http.Accept = "*/*";
  98.             http.Async = true;
  99.             string url = "http://captchatypers.com/captchaapi/UploadRecaptchav1.ashx?" +
  100.                 "action=UPLOADCAPTCHA" +
  101.                 "&username=" + ituser +
  102.                 "&password=" + itpass +
  103.                 "&googlekey=" + sitekey +
  104.                 "&pageurl=" + WebUtility.UrlEncode(siteurl);
  105.             http.HttpGet(url, (httpwait * 1000)).Trim();
  106.  
  107.             double wc = 0;
  108.             while(http.Html == "" && !http.Failed)
  109.             {
  110.                 wc++;
  111.                 if ((wc / 8) > httpwait)
  112.                 {
  113.                     errors++;
  114.                     failed = true;
  115.                     return;
  116.                 }
  117.                 status = "Uploading Recaptcha captcha (" + Math.Round((wc / 8), 0) + "/" +
  118.                   httpwait + ")";
  119.                 Thread.Sleep(125);
  120.             }
  121.             string html = http.Html.Trim();
  122.  
  123.             if (html.Contains("ERROR"))
  124.             {
  125.                 errors++;
  126.                 failed = true;
  127.                 return;
  128.             }
  129.             long capidlong = 0;
  130.             if (!long.TryParse(html, out capidlong))
  131.             {
  132.                 errors++;
  133.                 failed = true;
  134.                 return;
  135.             }
  136.             capid = capidlong.ToString();
  137.  
  138.             status = "Solving Recaptcha captcha";
  139.             double sc = 0;
  140.             wc = 0;
  141.             while(true)
  142.             {
  143.                 sc++;
  144.                 if ((wc / 8) >= startwait && ((wc / 8) == startwait || (sc / 8) == checkwait))
  145.                 {
  146.                     sc = 0;
  147.                     http = new Http();
  148.                     http.Accept = "*/*";
  149.                     http.Async = true;
  150.                     url = "http://captchatypers.com/captchaapi/GetRecaptchaText.ashx?" +
  151.                       "action=GETTEXT" +
  152.                       "&username=" + ituser +
  153.                       "&password=" + itpass +
  154.                       "&Captchaid=" + capid.Trim();
  155.                     http.HttpGet(url, (httpwait * 1000));
  156.  
  157.                     int hwc = 0;
  158.                     while (http.Html == "" && !http.Failed && (hwc / 8) < httpwait)
  159.                     {
  160.                         wc++;
  161.                         hwc++;
  162.                         if ((wc / 8) > maxwait)
  163.                         {
  164.                             ClaimBad();
  165.                             errors++;
  166.                             failed = true;
  167.                             return;
  168.                         }
  169.                         status = "Solving Recaptcha captcha (" + Math.Round((wc / 8), 0) + "/" +
  170.                           maxwait + ")";
  171.                         Thread.Sleep(125);
  172.                     }
  173.                     html = http.Html.Trim();
  174.  
  175.                     if (html.Contains("ERROR") && !html.Contains("NOT_DECODED"))
  176.                     {
  177.                         ClaimBad();
  178.                         errors++;
  179.                         failed = true;
  180.                         return;
  181.                     }
  182.                     if (!html.Contains("ERROR") && html.Length > 50)
  183.                     {
  184.                         res = html;
  185.                         break;
  186.                     }
  187.                 }
  188.                 else
  189.                 {
  190.                     wc++;
  191.                     status = "Solving Recaptcha captcha (" + Math.Round((wc / 8), 0) + "/" +
  192.                       maxwait + ")";
  193.                     Thread.Sleep(125);
  194.                 }
  195.             }
  196.  
  197.             balthread = new Thread(GetBalance);
  198.             balthread.Start();
  199.             errors = 0;
  200.         }
  201.  
  202.  
  203.         // http://captchatypers.com/Forms/SetBadImage.ashx?action=SETBADIMAGE&username=&password=imageid=
  204.         public void ClaimBad()
  205.         {
  206.             if (capid == "") { return; }
  207.             Http http = new Http();
  208.             http.Accept = "*/*";
  209.             http.Async = true;
  210.             string url = "http://captchatypers.com/Forms/SetBadImage.ashx";
  211.             string data = "action=SETBADIMAGE" +
  212.               "&username=" + ituser +
  213.               "&password=" + itpass +
  214.               "&imageid=" + capid;
  215.             http.HttpPost(url, data);
  216.         }
  217.  
  218.  
  219.         // http://www.captchatypers.com/Forms/RequestBalance.ashx?action=REQUESTBALANCE&username=&password=
  220.         public void GetBalance()
  221.         {
  222.             Http http = new Http();
  223.             http.Accept = "*/*";
  224.             string url = "http://www.captchatypers.com/Forms/RequestBalance.ashx";
  225.             string data = "action=REQUESTBALANCE" +
  226.               "&username=" + ituser +
  227.               "&password=" + itpass;
  228.             string html = http.HttpPost(url, data);
  229.             double baldbl = 0;
  230.             if (double.TryParse(html, out baldbl)) { balance = baldbl; }
  231.         }
  232.     }
  233. }
Add Comment
Please, Sign In to add comment