Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $count = 0;
- $captcha = 0;
- $aim = $_POST['aim']; //245909964;
- if (empty($aim)) {
- $aim = 1;
- }
- $c = $_POST['count'];
- $group = 157188546;
- $data = array ("", ""); //(id, pass, id2, pass2...)
- $i = 0;
- $j = 0;
- $client_id = '3697615';
- $client_secret = 'AlVXZFMUqyrnABp8ncuU';
- $domain = 'https://oauth.vk.com/';
- function send_captcha($image_id) {
- $imagedata = file_get_contents('http://api.vk.com/captcha.php?sid=660914944611');
- $base64 = base64_encode($imagedata);
- $request_data = array('clientKey' => 'КЛЮЧ АНТИКАПЧИ', 'task' => array('type' => 'ImageToTextTask', 'body' => $base64));
- $json = json_encode($request_data);
- $ch = curl_init('https://api.anti-captcha.com/createTask');
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $response = curl_exec($ch);
- $obj = json_decode($response);
- return $obj->{'taskId'};
- }
- function get_captcha_text($task_id) {
- $request_data = array('clientKey' => 'КЛЮЧ АНТИКАПЧИ', 'taskId' => $task_id);
- $json = json_encode($request_data);
- $ch = curl_init('https://api.anti-captcha.com/getTaskResult');
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $response = curl_exec($ch);
- $obj = json_decode($response);
- if (($obj->{'errorId'}) == 0) {
- if ($obj->{'status'} == 'ready') {
- if (!(empty($obj->{'solution'}->{'text'}))) {
- return $obj->{'solution'}->{'text'};
- }
- } else {
- sleep(2);
- $text = get_captcha_text($task_id);
- return $text;
- }
- } else {
- return 1;
- }
- }
- $request_data = array('clientKey' => 'КЛЮЧ АНТИКАПЧИ', 'task' => array('type' => 'ImageToTextTask', 'body' => $base64) );
- $json = json_encode($request_data);
- function get_curl($url) {
- if (function_exists('curl_init')) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- $output = curl_exec($ch);
- echo curl_error($ch);
- curl_close($ch);
- return $output;
- } else {
- return file_get_contents($url);
- }
- }
- while (!(empty($data[$i]))) {
- $url = $domain.'token?grant_type=password&client_id='.$client_id.'&client_secret='.$client_secret.'&username='.$data[$i++].'&password='.$data[$i++].'&v=5.69&2fa_supported=1';
- $html = get_curl($url, true);
- $obj = json_decode($html);
- if (empty($obj->{'error'})) {
- $array[$j]['token'] = $obj->{'access_token'};
- $array[$j++]['uid'] = $obj->{'user_id'};
- }
- }
- $j = 0;
- while ($count < $c) {
- usleep(500000);
- $url = 'https://api.vk.com/method/groups.invite?group_id='.$group.'&user_id='.$aim.'&v=5.59&access_token='.$array[$j]['token'].$param;
- if (!(empty($param))) {
- $param = '';
- }
- $html = get_curl($url, true);
- $obj = json_decode($html);
- //var_dump($obj);
- //die();
- if (($obj->{'error'}->{'error_code'}) == 14) {
- $task = send_captcha($task);
- sleep(2);
- $text = get_captcha_text($task);
- $param = '&captcha_sid=660914944611&captcha_key='.$text;
- $captcha++;
- } else {
- if (($obj->{'error'}->{'error_code'}) == 103) {
- die('<b>Упс. Лимит на приглашения.</b> <br>Разослано пришлашений: '.$count.' <br>Введено каптч: '.$captcha.' <br>ID группы: '.$group);
- } else {
- if (($obj->{'error'}->{'error_code'}) == 15) {
- die("<b>".$obj->{'error'}->{'error_msg'}.".</b> <br>Разослано пришлашений: ".$count." <br>Введено каптч: ".$captcha." <br>ID группы: ".$group);
- } else {
- if (($obj->{'error'}->{'error_code'}) == '') {
- $j += 2;
- $count++;
- if (empty($array[$j]['token'])) {
- $j = 0;
- }
- }
- }
- }
- }
- $url = 'https://api.vk.com/method/groups.removeUser?group_id='.$group.'&user_id='.$aim.'&v=5.59&access_token='.$array[$j]['token'];
- $html = get_curl($url, true);
- }
- echo 'Разослано пришлашений: '.$count.' <br>Введено каптч: '.$captcha.' <br>ID группы: '.$group;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement