/// <summary> /// Handles the CaptchaRequired event of the omegle class. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void omegle_CaptchaRequired(object sender, CaptchaRequiredArgs args) { SetStatus("Captcha required.", false); omegle.Stop(); this.Invoke(new MethodInvoker(delegate { HtmlElement form = conversationBox.Document.CreateElement("form"); HtmlElement recaptchaControl = conversationBox.Document.CreateElement("div"); form.Id = "recaptcha_form"; form.AppendChild(recaptchaControl); recaptchaControl.Id = "recaptcha_div"; EventHandler onSubmit = null; form.AttachEventHandler("onsubmit", onSubmit = new EventHandler(delegate { form.DetachEventHandler("onsubmit", onSubmit); string response = conversationBox.Document.InvokeScript("get_response").ToString(); string challenge = conversationBox.Document.InvokeScript("get_challenge").ToString(); conversationBox.Document.InvokeScript("destroy_recaptcha"); form.Parent.InvokeMember("removeChild", new object[] { form.DomElement }); omegle.SendCaptcha(challenge, response); omegle.Start(); textEntryBox.Enabled = true; })); conversationBox.Document.Body.AppendChild(form); conversationBox.Document.InvokeScript("do_recaptcha", new object[] { args.id, recaptchaControl.Id }); textEntryBox.Enabled = false; conversationBox.Focus(); this.Flash(); })); }
private static void omegle_CaptchaRequired(object sender, CaptchaRequiredArgs e) { Console.ResetColor(); Console.WriteLine("Captcha Required. Press any key to launch browser."); Console.ReadKey(); PostSubmitter post = new PostSubmitter(); post.Url = "http://www.google.com/recaptcha/api/challenge"; post.PostItems.Add("k", e.id); post.PostItems.Add("ajax", "1"); post.Type = PostSubmitter.PostTypeEnum.Get; string response = "{" + post.Post().Split(new char[] { '{', '}' })[1] + "}"; string challenge = JsonConvert.DeserializeObject<JObject>(response)["challenge"].ToString(); captchaURL = "http://www.google.com/recaptcha/api/image?c=" + challenge; //System.Diagnostics.Process.Connect("http://www.google.com/recaptcha/api/image?c=" + challenge); captcha.ShowDialog(); Console.Write("Please Input Captcha: "); string userInput = Console.ReadLine(); if (userInput != string.Empty) omegle.SendCaptcha(challenge, userInput); else omegle.Reconnect(); }
private void CaptchaRequired(object sender, CaptchaRequiredArgs e) { ChatBrowser.PrintMessage("OmegleMTM", "Captcha Required!!", System.Drawing.Color.DarkGreen); }