Esempio n. 1
0
        private string GetAnswer(string key)
        {
            using (var client = new WebClient())
            {
                client.DownloadFile($"https://ext.captcha.yandex.net/image?key={key}", "captcha.jpg");
            }

            Rucaptcha.Key = "80772be92ec6b923a46970078c3ec829";
            var cap = Rucaptcha.Recognize("captcha.jpg");

            return(cap);
        }
Esempio n. 2
0
        public string Auth(long captcha_sid, string captcha_key, string pass, string log, int i, VkApi vk, string capkey)
        {
            try
            {
                ulong    appId = 2685278;      // указываем id приложения
                string   email = log;          // email для авторизации
                string   passa = pass;         // пароль для авторизации
                Settings scope = Settings.All; // уровень доступа к данным

                if (captcha_sid != 0 && captcha_key != "")
                {
                    DateTime dy      = DateTime.Now;
                    string   Textzy  = string.Format("{0:t}", dy);
                    string   Timey   = Textzy.ToString();
                    Action   actiony = () =>
                    {
                        richTextBoxAccz.Text += "\n[" + Timey + "] Капча решена. Текущий баланс на рукапче: " + Rucaptcha.Balance() + " руб.\n";
                    };
                    Invoke(actiony);

                    vk.Authorize(new ApiAuthParams
                    {
                        ApplicationId = appId,
                        Login         = email,
                        Password      = passa,
                        Settings      = scope,
                        CaptchaSid    = captcha_sid,
                        CaptchaKey    = captcha_key
                    });
                }
                else
                {
                    CountOfGr = 0;
                    vk.Authorize(new ApiAuthParams
                    {
                        ApplicationId = appId,
                        Login         = email,
                        Password      = passa,
                        Settings      = scope,
                    });
                }

                if (Convert.ToInt32(i + 1) == 2)
                {
                    DateTime d      = DateTime.Now;
                    string   Textz  = string.Format("{0:t}", d);
                    string   Time   = Textz.ToString();
                    Action   action = () =>
                    {
                        richTextBoxAccz.Text += "\n[" + Time + "] Выполнен вход во " + Convert.ToInt32(i + 1) + " аккаунт, с логином: " + log + ".\n";
                    };
                    Invoke(action);
                }
                else
                {
                    DateTime d      = DateTime.Now;
                    string   Textz  = string.Format("{0:t}", d);
                    string   Time   = Textz.ToString();
                    Action   action = () =>
                    {
                        richTextBoxAccz.Text += "\n[" + Time + "] Выполнен вход в " + Convert.ToInt32(i + 1) + " аккаунт, с логином: " + log + ".\n";
                    };
                    Invoke(action);
                }
                return("ok");
            }
            catch (VkNet.Exception.CaptchaNeededException cEx)
            {
                DateTime d      = DateTime.Now;
                string   Textz  = string.Format("{0:t}", d);
                string   Time   = Textz.ToString();
                Action   action = () =>
                {
                    richTextBoxAccz.Text += "\n[" + Time + "] Попалась капча.\n";
                };
                //рагад, получение капча кей
                Rucaptcha.Key = capkey;
                long   captcha_sida = cEx.Sid;
                string captcha_url  = cEx.Img.ToString();
                string captchaPath  = Rucaptcha.Download_Captcha(captcha_url);
                string captcha_keya = Rucaptcha.Recognize(captchaPath);
                Auth(captcha_sida, captcha_keya, pass, log, i, vk, capkey);
                return("bad");
            }
        }
Esempio n. 3
0
        private void StartPosting(string[] lines1, string[] lines2, string text1, string text2, string text3, string[] lines3, string text4, bool check1, decimal num1, decimal num2, decimal num3)
        {
            string capkey = text3;

            Rucaptcha.Key = capkey;
            string bal  = Rucaptcha.Balance();
            double bala = double.Parse(bal.Replace(".", ","));

            text1 = text1.Replace(" ", "");
            text3 = text3.Replace(" ", "");
            text4 = text4.Replace(" ", "");

            try
            {
                if ((text1 != "" && !text1.Contains("логин")) && (text2 != "" && !text2.Contains("Здесь Ваш текст.")) && (!bal.Contains("ERROR")))
                {
HERE:
                    if (!thread_stop)
                    {
                        for (int loo = 1; loo <= num3; loo++)
                        {
                            ko   = 0;
                            koko = 0;
                            if (bala < 10)
                            {
                                DateTime d      = DateTime.Now;
                                string   Textz  = string.Format("{0:t}", d);
                                string   Time   = Textz.ToString();
                                Action   action = () =>
                                {
                                    richTextBoxAccz.Text += "\n[" + Time + "] Баланс рукапчи не должен быть меньше 10-ти рублей. Пожалуйста, пополните. Текущий баланс: " + Rucaptcha.Balance() + ".\n";
                                };
                                Invoke(action);
                                thread_stop = true;
                                goto HERE;
                            }
                            if (!thread_stop)
                            {
                                if (num3 > 1)
                                {
                                    DateTime d22       = DateTime.Now;
                                    string   Textz22   = string.Format("{0:t}", d22);
                                    string   Time22    = Textz22.ToString();
                                    Action   action234 = () =>
                                    {
                                        richTextBoxAccz.Text += "\n[" + Time22 + "] Выполняемый цикл: " + loo + ".\n";
                                    };
                                    Invoke(action234);
                                }
                            }
                            for (int i = 0; i < lines1.Length; i++) // Count of Accs

                            {
                                lines1[i] = lines1[i].Replace(" ", "");

                                if (!lines1[i].Contains(';'))
                                {
                                    DateTime d      = DateTime.Now;
                                    string   Textz  = string.Format("{0:t}", d);
                                    string   Time   = Textz.ToString();
                                    Action   action = () =>
                                    {
                                        richTextBoxAccz.Text += "\n[" + Time + "] Пожалуйста, поставьте разделитель ';' на " + Convert.ToInt32(i + 1) + " строчке.\n";
                                    };
                                    Invoke(action);
                                }
                                else
                                {
                                    var s = lines1[i].Split(';');
                                    log  = s[0].ToString();
                                    pass = s[1].ToString();

                                    try
                                    {
                                        CountOfGr = 0;
                                        var vk = new VkApi();

                                        if (!thread_stop)
                                        {
                                            string result_auth = Auth(0, "", pass, log, i, vk, capkey); // Автоpизация
                                        }
                                        if (!thread_stop)
                                        {
                                            for (int k = koko; k < lines2.Length; k++) // Кол-во строк в тексбоксе групп.
                                            {
                                                lines2[k] = lines2[k].Replace(" ", "");

                                                koko = k;
                                                if (ko == num2)
                                                {
                                                    ko = 0;
                                                    break;
                                                }

                                                if (!thread_stop)
                                                {
                                                    if (text2.Contains(';'))
                                                    {
                                                        var te = text2.Split(';');
                                                        if (kaz == numericUpDown1.Value)
                                                        {
                                                            ka++;
                                                            kaz = numericUpDown1.Value - 1;
                                                        }
                                                        if (ka == te.Length)
                                                        {
                                                            ka  = 0;
                                                            kaz = 0;
                                                        }
                                                        texta = te[ka];
                                                        kaz++;
                                                    }
                                                    else
                                                    {
                                                        texta = text2;
                                                    }

                                                    firstIsVowel = (new Regex(@"club[0-9]{4,12}$").IsMatch(lines2[k]));

                                                    if (firstIsVowel && !lines2[k].Contains("группа"))
                                                    {
                                                        if (checkBox1.Checked == true)
                                                        {
                                                            prove = true;
                                                        }
                                                        else
                                                        {
                                                            prove = false;
                                                        }

                                                        var tro = lines2[k];
                                                        tro = tro.Replace("https://vk.com/club", "");
                                                        tro = tro.Replace("vk.com/club", "");
                                                        long id = long.Parse(tro);

                                                        Message(lines2, k, 0, "", prove, id, texta, vk, capkey, text4, check1, lines3, num1); // Оставить сообщение
                                                    }
                                                    else if (!firstIsVowel && !lines2[k].Contains("группа") && lines2[k].Contains("vk.com"))
                                                    {
                                                        if (checkBox1.Checked == true)
                                                        {
                                                            prove = true;
                                                        }
                                                        else
                                                        {
                                                            prove = false;
                                                        }
                                                        var tro = lines2[k];
                                                        tro = tro.Replace("https://vk.com/", "");
                                                        tro = tro.Replace("vk.com/", "");
                                                        VkObject obj = vk.Utils.ResolveScreenName(tro);
                                                        long?    ide = obj.Id;
                                                        string   ido = ide.ToString();
                                                        long     id  = long.Parse(ido);

                                                        Message(lines2, k, 0, "", prove, id, texta, vk, capkey, text4, check1, lines3, num1); // Оставить сообщение
                                                    }
                                                    else
                                                    {
                                                        DateTime di      = DateTime.Now;
                                                        string   Textza  = string.Format("{0:t}", di);
                                                        string   Timea   = Textza.ToString();
                                                        Action   action5 = () =>
                                                        {
                                                            richTextBoxAccz.Text += "\n[" + Timea + "] Пожалуйста, введите список групп в дополнительных настройках. В формате: vk.com/группа.\n";
                                                        };
                                                        Invoke(action5);
                                                    }
                                                }
                                                ko++;
                                            }
                                        }
                                    }
                                    catch (Exception eXa)
                                    {
                                        MessageBox.Show(eXa.ToString());
                                        DateTime di     = DateTime.Now;
                                        string   Textza = string.Format("{0:t}", di);
                                        string   Timea  = Textza.ToString();
                                        Action   action = () =>
                                        {
                                            richTextBoxAccz.Text += "\n[" + Timea + "] Ошибка, невозможно авторизоваться в аккаунт с логином: " + log + ".\n";
                                        };
                                        Invoke(action);
                                    }
                                }
                            } // accz
                        }     // Loop
                    }         // if thread_stop != true
                }
                else
                {
                    if (text1 == "" || text1.Contains("логин"))
                    {
                        DateTime d      = DateTime.Now;
                        string   Textz  = string.Format("{0:t}", d);
                        string   Time   = Textz.ToString();
                        Action   action = () =>
                        {
                            richTextBoxAccz.Text += "\n[" + Time + "] Пожалуйста, введите логин и пароль от аккаунта.\n";
                        };
                        Invoke(action);
                    }
                    if (text2 == "" || text2.Contains("Здесь Ваш текст."))
                    {
                        DateTime d         = DateTime.Now;
                        string   Textz     = string.Format("{0:t}", d);
                        string   Time      = Textz.ToString();
                        Action   action234 = () =>
                        {
                            richTextBoxAccz.Text += "\n[" + Time + "] Пожалуйста, введите текст в дополнительных настройках.\n";
                        };
                        Invoke(action234);
                    }
                    if (bal.Contains("ERROR"))
                    {
                        DateTime d        = DateTime.Now;
                        string   Textz    = string.Format("{0:t}", d);
                        string   Time     = Textz.ToString();
                        Action   action23 = () =>
                        {
                            richTextBoxAccz.Text += "\n[" + Time + "] Пожалуйста, введите API ключ от сервиса rucaptcha.com.\n";
                        };
                        Invoke(action23);
                    }
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.ToString());
            }

            DateTime dp        = DateTime.Now;
            string   Textzp    = string.Format("{0:t}", dp);
            string   Timep     = Textzp.ToString();
            Action   actionaio = () =>
            {
                richTextBoxAccz.Text += "\n[" + Timep + "] Работа успешно завершена.\n";
                button2.Enabled       = true;
                thread_stop           = true;
                button1.Text          = "Запуск";
            };

            Invoke(actionaio);
        }
Esempio n. 4
0
        public string Message(string[] lines2, int k, long captcha_sid, string captcha_key, bool prove, long id, string texta, VkApi vk, string capkey, string text4, bool check1, string[] lines3, decimal num1)
        {
            try

            {
                if (check1 == true && text4 != "" && num1 == 1)
                {
                    secondVowelP = (new Regex(@"^photo[0-9]{4,13}_[0-9]{4,13}$").IsMatch(lines3[l]));
                    secondVowelM = (new Regex(@"^photo[0-9]{4,13}_[0-9]{4,13}$").IsMatch(lines3[l]));

                    if (!(lines3.Length >= 1) && (!secondVowelM || !secondVowelP)) //добавить проверку на ID Регулярным выражением
                    {
                        DateTime dy      = DateTime.Now;
                        string   Textzy  = string.Format("{0:t}", dy);
                        string   Timey   = Textzy.ToString();
                        Action   actiony = () =>
                        {
                            richTextBoxAccz.Text += "\n[" + Timey + "] Картинка не размещена, введен неверный формат.\n";
                        };
                        Invoke(actiony);
                    }
                    else
                    {
                        lines3[l] = lines3[l].Replace(" ", "");
                        var  ph     = lines3[l].Replace("photo", "");
                        var  zasada = ph.Split('_');
                        long pervuy = long.Parse(zasada[0]);
                        long vtoroy = long.Parse(zasada[1]);

                        if (captcha_sid != 0 && captcha_key != "")
                        {
                            DateTime dy      = DateTime.Now;
                            string   Textzy  = string.Format("{0:t}", dy);
                            string   Timey   = Textzy.ToString();
                            Action   actiony = () =>
                            {
                                richTextBoxAccz.Text += "\n[" + Timey + "] Капча решена. Текущий баланс на рукапче: " + Rucaptcha.Balance() + " руб.\n";
                            };
                            Invoke(actiony);

                            var attachment = new List <MediaAttachment>();
                            var media      = new Photo();
                            media.OwnerId = pervuy;
                            media.Id      = vtoroy;
                            attachment.Add(media);

                            var post = vk.Wall.Post(new WallPostParams
                            {
                                OwnerId     = -id,
                                FromGroup   = prove,
                                Message     = texta,
                                Attachments = attachment,
                                CaptchaSid  = captcha_sid,
                                CaptchaKey  = captcha_key
                            });
                            l++;
                        }
                        else
                        {
                            var attachment = new List <MediaAttachment>();
                            var media      = new Photo();
                            media.OwnerId = pervuy;
                            media.Id      = vtoroy;
                            attachment.Add(media);

                            var post = vk.Wall.Post(new WallPostParams
                            {
                                OwnerId     = -id,
                                FromGroup   = prove,
                                Message     = texta,
                                Attachments = attachment
                            });
                            l++;
                        }
                    }
                }


                else if (check1 == true && text4 != "" && num1 == 2 && lines3.Length >= 2)
                {
                    secondVowelP = (new Regex(@"^photo[0-9]{4,13}_[0-9]{4,13}$").IsMatch(lines3[l]));
                    secondVowelM = (new Regex(@"^photo-[0-9]{4,13}_[0-9]{4,13}$").IsMatch(lines3[l]));

                    if (!secondVowelM || !secondVowelP) //добавить проверку на ID егулярным выражением
                    {
                        DateTime dy      = DateTime.Now;
                        string   Textzy  = string.Format("{0:t}", dy);
                        string   Timey   = Textzy.ToString();
                        Action   actiony = () =>
                        {
                            richTextBoxAccz.Text += "\n[" + Timey + "] Картинка не размещена, введен неверный формат.\n";
                        };
                        Invoke(actiony);
                    }
                    else
                    {
                        string pha;
                        lines3[l] = lines3[l].Replace(" ", "");
                        var  ph     = lines3[l].Replace("photo", "");
                        var  zasada = ph.Split('_');
                        long pervuy = long.Parse(zasada[0]);
                        long vtoroy = long.Parse(zasada[1]);
                        if (l == lines3.Length - 1)
                        {
                            lines3[0] = lines3[0].Replace(" ", "");
                            pha       = lines3[0].Replace("photo", "");
                        }
                        else
                        {
                            lines3[Convert.ToInt32(l + 1)] = lines3[Convert.ToInt32(l + 1)].Replace(" ", "");
                            pha = lines3[Convert.ToInt32(l + 1)].Replace("photo", "");
                        }
                        var  zasada2 = pha.Split('_');
                        long pervuy2 = long.Parse(zasada2[0]);
                        long vtoroy2 = long.Parse(zasada2[1]);


                        if (captcha_sid != 0 && captcha_key != "")
                        {
                            DateTime dy      = DateTime.Now;
                            string   Textzy  = string.Format("{0:t}", dy);
                            string   Timey   = Textzy.ToString();
                            Action   actiony = () =>
                            {
                                richTextBoxAccz.Text += "\n[" + Timey + "] Капча решена. Текущий баланс на рукапче: " + Rucaptcha.Balance() + " руб.\n";
                            };
                            Invoke(actiony);

                            var attachment = new List <MediaAttachment>();
                            var media      = new Photo();
                            media.OwnerId = pervuy;
                            media.Id      = vtoroy;
                            attachment.Add(media);

                            var media2 = new Photo();
                            media2.OwnerId = pervuy2;
                            media2.Id      = vtoroy2;
                            attachment.Add(media2);

                            var post = vk.Wall.Post(new WallPostParams
                            {
                                OwnerId     = -id,
                                FromGroup   = prove,
                                Message     = texta,
                                Attachments = attachment,
                                CaptchaSid  = captcha_sid,
                                CaptchaKey  = captcha_key
                            });
                            l += 2;
                        }
                        else
                        {
                            var attachment = new List <MediaAttachment>();
                            var media      = new Photo();
                            media.OwnerId = pervuy;
                            media.Id      = vtoroy;
                            attachment.Add(media);

                            var media2 = new Photo();
                            media2.OwnerId = pervuy2;
                            media2.Id      = vtoroy2;
                            attachment.Add(media2);

                            var post = vk.Wall.Post(new WallPostParams
                            {
                                OwnerId     = -id,
                                FromGroup   = prove,
                                Message     = texta,
                                Attachments = attachment
                            });

                            l += 2;
                        }
                    }
                }

                else
                {
                    if (captcha_sid != 0 && captcha_key != "")
                    {
                        DateTime dy      = DateTime.Now;
                        string   Textzy  = string.Format("{0:t}", dy);
                        string   Timey   = Textzy.ToString();
                        Action   actiony = () =>
                        {
                            richTextBoxAccz.Text += "\n[" + Timey + "] Капча решена. Текущий баланс на рукапче: " + Rucaptcha.Balance() + " руб.\n";
                        };
                        Invoke(actiony);


                        var post = vk.Wall.Post(new WallPostParams
                        {
                            OwnerId    = -id,
                            FromGroup  = prove,
                            Message    = texta,
                            CaptchaSid = captcha_sid,
                            CaptchaKey = captcha_key
                        });
                    }
                    else
                    {
                        var post = vk.Wall.Post(new WallPostParams
                        {
                            OwnerId   = -id,
                            FromGroup = prove,
                            Message   = texta
                        });
                    }
                }


                CountOfGr++;
                DateTime di      = DateTime.Now;
                string   Textza  = string.Format("{0:t}", di);
                string   Timea   = Textza.ToString();
                Action   action2 = () =>
                {
                    richTextBoxAccz.Text += "\n[" + Timea + "] Оставлена запись в сообществе: " + lines2[k].Replace("https://", "") + ".\n";
                };
                Invoke(action2);
                if (!(lines2.Length == CountOfGr))
                {
                    DateTime diz      = DateTime.Now;
                    string   Textzaza = string.Format("{0:t}", diz);
                    string   Timeaza  = Textzaza.ToString();
                    Action   actionza = () =>
                    {
                        var numa = numericUpDown2.Value.ToString();
                        if (numa[numa.Length - 1] == '1')
                        {
                            richTextBoxAccz.Text += "\n[" + Timeaza + "] Пауза: " + numericUpDown2.Value + " секунду.\n";
                        }
                        else if (numa[numa.Length - 1] == '2' || numa[numa.Length - 1] == '3' || numa[numa.Length - 1] == '4')
                        {
                            richTextBoxAccz.Text += "\n[" + Timeaza + "] Пауза: " + numericUpDown2.Value + " секунды.\n";
                        }
                        else if (numa[numa.Length - 1] == '0' || numa[numa.Length - 1] == '5' || numa[numa.Length - 1] == '6' || numa[numa.Length - 1] == '7' || numa[numa.Length - 1] == '8' || numa[numa.Length - 1] == '9')
                        {
                            richTextBoxAccz.Text += "\n[" + Timeaza + "] Пауза: " + numericUpDown2.Value + " секунд.\n";
                        }
                    };
                    Invoke(actionza);

                    for (int tima = 1; tima <= numericUpDown2.Value; tima++)
                    {
                        if (!thread_stop)
                        {
                            Thread.Sleep(Convert.ToInt32(1000));
                        }
                        else if (thread_stop)
                        {
                            break;
                        }
                    }
                }
            }
            catch (VkNet.Exception.CaptchaNeededException cEx)
            {
                DateTime di      = DateTime.Now;
                string   Textza  = string.Format("{0:t}", di);
                string   Timea   = Textza.ToString();
                Action   action3 = () =>
                {
                    richTextBoxAccz.Text += "\n[" + Timea + "] Попалась капча.\n";
                };
                Invoke(action3);

                Rucaptcha.Key = capkey;
                long   captcha_sida = cEx.Sid;
                string captcha_url  = cEx.Img.ToString();
                string captchaPath  = Rucaptcha.Download_Captcha(captcha_url);
                string captcha_keya = Rucaptcha.Recognize(captchaPath);
                Message(lines2, k, captcha_sida, captcha_keya, prove, id, texta, vk, capkey, text4, check1, lines3, num1);
            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.ToString());
                DateTime di      = DateTime.Now;
                string   Textza  = string.Format("{0:t}", di);
                string   Timea   = Textza.ToString();
                Action   action3 = () =>
                {
                    richTextBoxAccz.Text += "\n[" + Timea + "] Не получилось оставить запись в сообществе: " + lines2[k] + ", возможно, закрыта стена или выбран пункт \"Публикация от имени сообщества\", не имея прав в группе.\n";
                };
                Invoke(action3);
            }


            if (num1 == 1)
            {
                if (l >= lines3.Length - 1)
                {
                    l = 0;
                }
            }
            else if (num1 == 2)
            {
                if (l >= lines3.Length)
                {
                    l = 0;
                }
            }

            return("good");
        }