masterLomaster
Client
- Регистрация
- 08.07.2015
- Сообщения
- 2 848
- Благодарностей
- 712
- Баллы
- 113
скопипастил код вставил, теперь выдает ошибкуВот, работает без переменных из ПМ
Код://Get запрос, получаем куки-хуюки var resultGet = ZennoPoster.HttpGet( "https://e.mail.ru/signup?from=main_noc", "", "utf-8", InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody, 5000, "", project.Profile.UserAgent, true, 5, AdditionalHeaders: new [] { "Host: e.mail.ru", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: uk,ru;q=0.8,en-US;q=0.5,en;q=0.3 ", //+project.Profile.AcceptLanguage, "Accept-Encoding: gzip, deflate, br" ,//+project.Profile.AcceptEncoding, "Referer: https://e.mail.ru/signup?from=main_noc", "Connection: keep-alive" } ); // Парсим регулярками переменные var cookie = Regex.Match(resultGet, "(?<=Set-Cookie: ).*?(?=;)").Value; var id = Regex.Match(resultGet, "(?<=<input\\ type=\"hidden\" name=\"ID\" value=\").*(?=\"/>)").Value; var x_reg_id = Regex.Match(resultGet, "(?<='x_reg_id':\\ ').*(?=')").Value; var name = Regex.Match(resultGet, "(?<=:first',\\ 'firstName':\\ 'input\\[name=\\\\').*?(?=\\\\']:)").Value; var surname = Regex.Match(resultGet, "(?<=:first',\\ 'lastName':\\ 'input\\[name=\\\\').*?(?=\\\\']:)").Value; var year = Regex.Match(resultGet, "(?<='x_reg_id', ').*?(?=', 'BirthMonth', ')").Value; var sex = Regex.Match(resultGet, "(?<=<input type=\"radio\" class=\"vtm\" name=\").*?(?=\" value=\"1\" id=\"man1\">)").Value; var email = Regex.Match(resultGet, "(?<=\\{'login':\\ 'input\\[name=\\\\').*?(?=\\\\'])").Value; var password1 = Regex.Match(resultGet, "(?<=name=\").*?(?=\" value=\"\" type=\"password\")").Value; var password2 = Regex.Match(resultGet, "(?<=name=\").*?(?=\" value=\"\" type=\"password\")", RegexOptions.RightToLeft).Value; var catpcha = Regex.Match(resultGet, "(?<=<input id=\"captchaCode\" class=\"inPut form__captcha-old__input\" type=\"text\" name=\").*?(?=\" value=\")").Value; var cpat = Regex.Match(resultGet, "(?<=2\\?r=).*?(?=\"\\ )").Value; var day = Regex.Match(resultGet, "(?<=BirthMonth',\\ ').*?(?=\')").Value; //Get на каптчу var captcha__get = ZennoPoster.HttpGet( "http://c.mail.ru/c/2?r=" + cpat, "", "utf-8", InterfacesLibrary.Enums.Http.ResponceType.File, 5000, cookie, project.Profile.UserAgent, true, 5, AdditionalHeaders: new [] { "Host: e.mail.ru", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: uk,ru;q=0.8,en-US;q=0.5,en;q=0.3 ", //+project.Profile.AcceptLanguage, "Accept-Encoding: gzip, deflate, br" ,//+project.Profile.AcceptEncoding, "Referer: https://e.mail.ru/signup?from=main_noc", "Connection: keep-alive" } ); //Обрабатываем каптчу var image = System.Drawing.Image.FromFile(@captcha__get); string base64String = String.Empty; using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { image.Save(ms, System.Drawing.Imaging.ImageFormat.Png); byte[] imageBytes = ms.ToArray(); base64String = Convert.ToBase64String(imageBytes); } var result = ZennoPoster.CaptchaRecognition("RuCaptcha.dll", base64String, ""); // Указываем модуль распознавания var tmp = result.Split(new [] {"-|-"}, StringSplitOptions.None); if (tmp.Length <= 1) return null; //Post отправка данных регистрации на сервер var post = ZennoPoster.HttpPost( url:"https://e.mail.ru/reg?from=main_noc", content:"signup_b=1&sms=1&no_mobile=1&ID=" + id + "&Count=1&back=&browserData=NoJS&Mrim.Country=24&Mrim.Region=226&x_reg_id=" + x_reg_id + "&security_image_id=&geo_countryId=24&geo_cityId=226&geo_regionId=999998&geo_country=&geo_place=&lang=ru_RU&" + name + "=" + project.Profile.Name + "&" + surname + "=" + project.Profile.Surname + "&" + day + "=" + project.Profile.BornDay + "&BirthMonth=3&" + year + "=" + project.Profile.BornYear + "&your_town=Санкт-Петербург, Россия&" + sex + "=2&" +email + "=" + project.Profile.Login + "&RegistrationDomain=mail.ru&" + password1 + "=" + project.Profile.Password + "&" + password2 + "=" + project.Profile.Password + "&RemindPhoneCode=7&RemindPhone=&Password_Question=Custom&" + catpcha + "=" + tmp[0] + "&new_captcha=1", contentPostingType:"application/x-www-form-urlencoded", proxy:"", Encoding:"utf-8", respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderOnly, Timeout:30000, Cookies:cookie, UserAgent:project.Profile.UserAgent, UseRedirect:true, MaxRedirectCount:5, AdditionalHeaders: new [] { //"Host: e.mail.ru", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: uk,ru;q=0.8,en-US;q=0.5,en;q=0.3 ", //+project.Profile.AcceptLanguage, "Accept-Encoding: gzip, deflate, br" ,//+project.Profile.AcceptEncoding, "Referer: https://e.mail.ru/signup?from=main_noc", "Connection: keep-alive" } );
и еще вопрос, раз убрали все переменные, теперь в кубике нужно галку поставить, что код ничего не возвращает?