public string DecodeDBC(string[] args, out DeathByCaptcha.Client client) { try { client = (DeathByCaptcha.Client) new DeathByCaptcha.SocketClient(args[0], args[1]); client.Verbose = true; Console.WriteLine("Your balance is {0:F2} US cents", client.Balance);//Log("Your balance is " + client.Balance + " US cents "); if (!client.User.LoggedIn) { return(null); } if (client.Balance == 0.0) { return(null); } } catch { } client = null; return(null); }
private void ResolveGoogleCaptcha() { try { HtmlHelper.SetValueToElement(this.webBrowser.Document, "UserName", SystemWebsite_UserName); HtmlHelper.SetValueToElement(this.webBrowser.Document, "Password", SystemWebsite_Password); DeathByCaptcha.Client client = (DeathByCaptcha.Client) new DeathByCaptcha.HttpClient(DeathByCaptchaService_UserName, DeathByCaptchaService_Password); DeathByCaptcha.Captcha captcha = client.Decode( DeathByCaptcha.Client.DefaultTokenTimeout, new Hashtable() { { "type", 4 }, { "token_params", "{ \"googlekey\": \"" + HtmlHelper.GetGoogleKey(this.webBrowser.DocumentText) + "\", \"pageurl\": \"" + SystemWebsite_Url + "\" }" } } ); HtmlHelper.SetValueToElement(this.webBrowser.Document, "g-recaptcha-response", captcha.Text); this.RunActionAndWaitUntilPageLoaded(this.webBrowser, HtmlHelper.ClickElement(this.webBrowser.Document, "action:DoLogin")); } catch (Exception vE) { throw vE; } }
static public string DecodeDBC(string[] args, byte[] imageBytes) { try { // Put your DBC username & password here: //Client client = (Client)new HttpClient(args[0], args[1]); DeathByCaptcha.Client client = (DeathByCaptcha.Client) new DeathByCaptcha.SocketClient(args[0], args[1]); client.Verbose = true; Console.WriteLine("Your balance is {0:F2} US cents", client.Balance); for (int i = 2, l = args.Length; i < l; i++) { Console.WriteLine("Solving CAPTCHA {0}", args[i]); // Upload a CAPTCHA and poll for its status. Put the CAPTCHA image // file name, file object, stream, or a vector of bytes, and desired // solving timeout (in seconds) here: DeathByCaptcha.Captcha captcha = client.Decode(imageBytes, 2 * DeathByCaptcha.Client.DefaultTimeout); if (null != captcha) { Console.WriteLine("CAPTCHA {0:D} solved: {1}", captcha.Id, captcha.Text); //// Report an incorrectly solved CAPTCHA. //// Make sure the CAPTCHA was in fact incorrectly solved, do not //// just report it at random, or you might be banned as abuser. //if (client.Report(captcha)) //{ // Console.WriteLine("Reported as incorrectly solved"); //} //else //{ // Console.WriteLine("Failed reporting as incorrectly solved"); //} return(captcha.Text); } else { Console.WriteLine("CAPTCHA was not solved"); return(null); } } } catch (Exception ex) { } return(null); }
public override Captcha resolveRecaptcha(byte[] imageBytes, string Username, string Password) { string[] args = new string[] { Username, Password, "" }; Captcha objCaptcha = new Captcha(); DeathByCaptcha.Client client = (DeathByCaptcha.Client) new DeathByCaptcha.SocketClient(Username, Password); try { client.Verbose = true; Console.WriteLine("Your balance is {0:F2} US cents", client.Balance); for (int i = 2, l = args.Length; i < l; i++) { try { Console.WriteLine("Solving CAPTCHA {0}", args[i]); DeathByCaptcha.Captcha captcha = client.Decode(imageBytes, 2 * DeathByCaptcha.Client.DefaultTimeout); if (null != captcha) { Console.WriteLine("CAPTCHA {0:D} solved: {1}", captcha.Id, captcha.Text); objCaptcha.CaptchaImage = captcha.Text; return(objCaptcha); } else { Console.WriteLine("CAPTCHA was not solved"); return(objCaptcha); } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } return(objCaptcha); }
public string DecodeDBC(string[] args, byte[] imageBytes) { try { // Put your DBC username & password here: DeathByCaptcha.Client client = (DeathByCaptcha.Client) new DeathByCaptcha.SocketClient(args[0], args[1]); client.Verbose = true; Console.WriteLine("Your balance is {0:F2} US cents", client.Balance);//Log("Your balance is " + client.Balance + " US cents "); if (!client.User.LoggedIn) { //Log("Please check your DBC Account Details"); return(null); } if (client.Balance == 0.0) { //Log("You have 0 Balance in your DBC Account"); return(null); } for (int i = 2, l = args.Length; i < l; i++) { Console.WriteLine("Solving CAPTCHA {0}", args[i]); // Upload a CAPTCHA and poll for its status. Put the CAPTCHA image // file name, file object, stream, or a vector of bytes, and desired // solving timeout (in seconds) here: DeathByCaptcha.Captcha captcha = client.Decode(imageBytes, 2 * DeathByCaptcha.Client.DefaultTimeout); if (null != captcha) { Console.WriteLine("CAPTCHA {0:D} solved: {1}", captcha.Id, captcha.Text); //// Report an incorrectly solved CAPTCHA. //// Make sure the CAPTCHA was in fact incorrectly solved, do not //// just report it at random, or you might be banned as abuser. //if (client.Report(captcha)) //{ // Console.WriteLine("Reported as incorrectly solved"); //} //else //{ // Console.WriteLine("Failed reporting as incorrectly solved"); //} return(captcha.Text); } else { //Log("CAPTCHA was not solved"); Console.WriteLine("CAPTCHA was not solved"); return(null); } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup - SignupMultiThreaded() -- DecodeDBC() --> " + ex.Message, Globals.Path_AccountCreatorErrorLog); GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup - DecodeDBC() >>>> " + ex.Message + " || DateTime :- " + DateTime.Now, Globals.Path_TwtErrorLogs); } return(null); }