· 6 years ago · Dec 05, 2019, 08:44 PM
1<?php
2namespace InstagramAPI;
3require (__DIR__ . "/vendor/autoload.php");
4$ig = new Instagram();
5$climate = new \League\CLImate\CLImate();
6$climate->green()->bold("\n _ _\n| | | |\n| |__ _ _ _ __ ___ _ ____ _____ | |_ ___ _ __\n| '_ \\| | | | '_ \\ / _ \\ '__\\ \\ / / _ \\| __/ _ \\ '__|\n| | | | |_| | |_) | __/ | \\ V / (_) | || __/ |\n|_| |_|\\__, | .__/ \\___|_| \\_/ \\___/ \\__\\___|_|\n __/ | |\n |___/|_|");
7$climate->out("");
8$climate->green()->bold("Hypervoter Terminal");
9$climate->green()->bold("v1.8");
10$climate->out("");
11$climate->green("© Developed by HyperVoter (https://hypervoter.com)");
12$climate->out("");
13$option = getopt("g::");
14if (isset($option["g"])) {
15 generator($ig, $climate);
16} else {
17 run($ig, $climate);
18}
19function generator($ig, $climate) {
20 $climate->backgroundBlueWhite("Hypervote Config Generator is Starting... ");
21 $climate->out("");
22 sleep(2);
23 $climate->out("Please provide a valid license key from your Dashboard on Hypervoter.com (https://hypervoter.com).");
24 sleep(1);
25 $climate->out("Example: j5tkjkl4f7e595e9008bb77acc599453");
26 $license_key = getVarFromUser("License key");
27 if (empty($license_key)) {
28 do {
29 $license_key = getVarFromUser("License key");
30 } while (empty($license_key));
31 }
32 $license_key = str_replace(" ", "", $license_key);
33 $license_status = activate_license($license_key, $ig, $climate);
34 if ("valid" === $license_status) {
35 $climate->out("You license active and valid. Processing...");
36 } else {
37 $climate->out("You license key not valid.");
38 }
39 sleep(1);
40 $climate->out("Please provide login data of your Instagram Account.");
41 $login = getVarFromUser("Login");
42 if (empty($login)) {
43 do {
44 $login = getVarFromUser("Login");
45 } while (empty($login));
46 }
47 sleep(1);
48 $password = getVarFromUser("Password");
49 if (empty($password)) {
50 do {
51 $password = getVarFromUser("Password");
52 } while (empty($password));
53 }
54 $first_loop = true;
55 while ($first_loop) {
56 $climate->out("(Optional) Set proxy, if needed. It's better to use a proxy from the same country where you running this script.");
57 $climate->out("Proxy should match following pattern:");
58 $climate->out("http://ip:port or http://username:password@ip:port");
59 $climate->out("Don't use in pattern https://.");
60 $climate->out("Type 3 to skip and don't use proxy.");
61 $first_loop = false;
62 }
63 $proxy = getVarFromUser("Proxy");
64 if (empty($proxy)) {
65 do {
66 $proxy = getVarFromUser("Proxy");
67 } while (empty($proxy));
68 }
69 if ("3" === $proxy) {
70 $proxy = "3";
71 } else {
72 if (isValidProxy($proxy, $climate)) {
73 }
74 }
75 $climate->out("Please choose the Hypervote estimated speed.");
76 $climate->out("Type integer value without spaces from 1 to 1 500 000 stories/day or 0 for maximum possible speed.");
77 $climate->out("We recommend you set 400000 stories/day. This speed works well for a long time without exceeding the limits.");
78 $climate->out("When you are using the maximum speed you may exceed the Hypervote limits per day if this account actively used by a user in the Instagram app at the same time.");
79 $climate->out("If you are using another type of automation, we recommend to you reducing Hypervote speed and find your own golden ratio.");
80 $speed = (int)getVarFromUser("Speed");
81 if (1500000 < $speed) {
82 do {
83 $climate->out("Speed value is incorrect. Type integer value from 1 to 1 500 000 stories/day.");
84 $climate->out("Type 0 for maximum speed.");
85 $speed = (int)getVarFromUser("Delay");
86 } while (1500000 < $speed);
87 }
88 if (0 == $speed) {
89 $climate->out("Maximum speed enabled.");
90 } else {
91 $climate->out("Speed set to " . $speed . " stories/day.");
92 }
93 $climate->out("Experimental features:");
94 $climate->out("Voting only fresh stories, which posted no more than X hours ago.");
95 $climate->out("X - is integer value from 1 to 23.");
96 $climate->out("Type 0 to skip this option.");
97 $climate->out("This option will reduce speed, but can increase results of Hypervote.");
98 $fresh_stories_range = 9;
99 if (23 < $fresh_stories_range) {
100 do {
101 $climate->out("Fresh stories range value is incorrect. Type integer value from 1 to 23.");
102 $climate->out("Type 0 for skip this option.");
103 $fresh_stories_range = 9;
104 } while (23 < $fresh_stories_range);
105 }
106 $defined_targs = getVarFromUser("Please define your targets. Use only usernames without \"@\" sign");
107 $q_answers = (int)getVarFromUser("Is Question Answers active? (0/1)");
108 $q_vote = (int)getVarFromUser("Is Poll Vote active? (0/1)");
109 $q_slide = (int)getVarFromUser("Is Slide Points active? (0/1)");
110 $q_quiz = (int)getVarFromUser("Is Quiz Answers active? (0/1)");
111 $q_stories = (int)getVarFromUser("Is Story Masslooking Active? (0/1)");
112 $climate->out("Please use this option with caution.Our algorithm is optimized for maximum efficiency and human behaviour. As developers, we are not responsible if your account blocked by Instagram.");
113 if (0 !== $q_answers) {
114 $q_answers_a = getVarFromUser("Please provide your answers (comma seperated. For Ex: hello,hi there,oh dear)");
115 }
116 if (0 !== $q_slide) {
117 $q_slide_points_min = (int)getVarFromUser("Please Provide Min. Slide Points (0/100)");
118 $q_slide_points_max = (int)getVarFromUser("Please Provide Max. Slide Points (0/100)");
119 do {
120 $climate->errorBold("Max value can not set lower than min value. Max value must set " . ($q_slide_points_min + 1) . " or bigger!");
121 $q_slide_points_max = (int)getVarFromUser("Please Provide Max. Slide Points (0/100)");
122 } while ($q_slide_points_max < $q_slide_points_min);
123 } else {
124 $q_slide_points_min = 9;
125 $q_slide_points_max = 109;
126 }
127 if (!empty($q_answers_a)) {
128 $qs = explode(",", $q_answers_a);
129 } else {
130 $qs = [];
131 }
132 $data = ["license_key" => $license_key, "username" => $login, "password" => $password, "proxy" => $proxy, "speed_value" => $speed, "targets" => $defined_targs, "fresh_stories_range" => 5, "is_poll_vote_active" => (0 === $q_vote ? false : true), "is_slider_points_active" => (0 === $q_slide ? false : true), "is_questions_answers_active" => (0 === $q_answers ? false : true), "is_quiz_answers_active" => (0 === $q_quiz ? false : true), "is_mass_story_vivew_active" => (0 === $q_stories ? false : true), "questions_answers" => $qs, "slider_points_range" => [($q_slide_points_min ? $q_slide_points_min : 0), ($q_slide_points_max ? $q_slide_points_max : 100) ]];
133 $choicebaby = $climate->confirm("All values are set. Do you want to save this configuration?");
134 if ($choicebaby->confirmed()) {
135 $filename = getVarFromUser("Please set a name for file");
136 if (file_exists(__DIR__ . "/config/config-" . $filename . ".json")) {
137 $climate->errorBold("File " . $filename . " already exists. Set a different name");
138 $filename = getVarFromUser("Please set a name for file");
139 }
140 $fp = fopen(__DIR__ . "/config/config-" . $filename . ".json", "w");
141 fwrite($fp, json_encode($data));
142 fclose($fp);
143 $climate->infoBold("Config file " . $filename . " successfully saved. Hyperloop starting in 3 seconds...");
144 sleep(3);
145 run($ig, $climate, $filename, NULL);
146 } else {
147 $choice2 = $climate->confirm(" All your changes not saved. Are you sure? ");
148 if ($choice2->confirmed()) {
149 $climate->info(" Allright. Hyperloop sequence starting with these info in 3 seconds... ");
150 sleep(3);
151 run($ig, $climate, NULL, json_encode($data));
152 } else {
153 $filename = getVarFromUser("Please set a name for file");
154 if (file_exists(__DIR__ . "/config/config-" . $filename . ".json")) {
155 $climate->errorBold("File " . $filename . " already exists. Set a different name");
156 $filename = getVarFromUser("Please set a name for file");
157 }
158 $fp = fopen(__DIR__ . "/config/config-" . $filename . ".json", "w");
159 fwrite($fp, json_encode($data));
160 fclose($fp);
161 $climate->infoBold("Config file " . $filename . " successfully saved. Hyperloop starting in 3 seconds...");
162 sleep(3);
163 run($ig, $climate, $filename, NULL);
164 }
165 }
166} function run($ig, $climate, $conf_name = NULL, $datajson = NULL) {
167 ini_set("memory_limit", "-1");
168 ini_set("max_execution_time", "-1");
169 try {
170 if (NULL == $datajson) {
171 if (NULL !== $conf_name) {
172 $climate->out("Config file name provided by generator. Processing...");
173 $config_name = $conf_name;
174 } else {
175 $climate->out("Please provide an username for config file...");
176 $config_name = getVarFromUser("Username");
177 }
178 if (empty($config_name)) {
179 do {
180 $config_name = getVarFromUser("Username");
181 } while (empty($config_name));
182 }
183 $climate->infoBold("Checking for config...");
184 sleep(1);
185 if (file_exists(__DIR__ . "/config/config-" . $config_name . ".json")) {
186 $climate->infoBold("Config file found. Processing...");
187 sleep(1);
188 $mafile = fopen(__DIR__ . "/config/config-" . $config_name . ".json", "r");
189 $file = fread($mafile, filesize(__DIR__ . "/config/config-" . $config_name . ".json"));
190 $data = json_decode($file);
191 fclose($mafile);
192 $climate->infoBold("Checking & Validating License key...");
193 sleep(1);
194 if ("" !== $data->license_key) {
195 $license_status = activate_license($data->license_key, $ig, $climate);
196 } else {
197 $climate->out("Please provide a valid license key from your Dashboard on Hypervoter.com (https://hypervoter.com).");
198 $climate->out("Example: j5tkjkl4f7e595e9008bb77acc599453");
199 $license_key = getVarFromUser("License key");
200 if (empty($license_key)) {
201 do {
202 $license_key = getVarFromUser("License key");
203 } while (empty($license_key));
204 }
205 $license_key = str_replace(" ", "", $license_key);
206 $license_status = activate_license($license_key, $ig, $climate);
207 if ("valid" === $license_status) {
208 $climate->out("You license active and valid.");
209 } else {
210 $climate->out("You license key not valid.");
211 run($ig, $climate);
212 }
213 sleep(1);
214 } if ("valid" === $license_status) {
215 $climate->backgroundBlueWhiteBold(" You license key is active and valid. Processing... ");
216 sleep(1);
217 if ("" !== $data->username) {
218 $climate->infoBold("Username Found");
219 $login = $data->username;
220 if ("" !== $data->password) {
221 $climate->infoBold("Password Found");
222 $password = $data->password;
223 if ("3" === $data->proxy) {
224 $climate->infoBold("Proxy Skipping Enabled. Processing ...");
225 $proxy = "3";
226 sleep(1);
227 } else {
228 $climate->infoBold("Proxy Option found. Validating...");
229 sleep(1);
230 $validate_proxy = isValidProxy($data->proxy, $climate);
231 $climate->infoBold("Proxy Status : " . $validate_proxy);
232 if (200 == $validate_proxy) {
233 $climate->info("Proxy Connected. Processing ...");
234 $proxy = $data->proxy;
235 $ig->setProxy($data->proxy);
236 } else {
237 $proxy = "3";
238 $climate->info("Proxy can not conntected. Skipping...");
239 }
240 }
241 if ($data->speed_value) {
242 $climate->infoBold("Speed Value Found. Processing ... ");
243 $speed = (int)$data->speed_value;
244 if (1500000 < $speed) {
245 do {
246 $climate->errorBold("Speed value is incorrect. Type integer value from 1 to 1 500 000 stories/day.");
247 usleep(500000);
248 $climate->errorBold("For Maxiumum speed please use \"0\"... Please set speed now (that will not change your config file)");
249 $speed = (int)getVarFromUser("Speed");
250 } while (1500000 < $speed);
251 }
252 if (0 === $speed) {
253 $climate->infoBold(" Maximum speed enabled. ");
254 $delay = 56;
255 } else {
256 $climate->infoBold("Speed set to " . $speed . " stories/day.");
257 $delay = round(17280000 / $speed);
258 }
259 }
260 if (0 < $data->fresh_stories_range) {
261 $fresh_stories_range = 10;
262 $climate->infoBold("Experimental Feature (Fresh Stories Range) value found. Validating ...");
263 sleep(1);
264 if (23 < $fresh_stories_range) {
265 do {
266 $climage->errorBold("Fresh stories range value is incorrect. Type integer value from 1 to 23.");
267 $climage->errorBold("Type 0 for skip this option.");
268 $fresh_stories_range = 10;
269 } while (23 < $fresh_stories_range);
270 }
271 $climate->infoBold("Fresh Stories Range set to " . $fresh_stories_range);
272 sleep(1);
273 } else {
274 $fresh_stories_range = 10;
275 $climate->infoBold("Experimental Feature (Fresh Stories Range) Skipping.");
276 usleep(500000);
277 }
278 $defined_targets = $data->targets;
279 if ($data->is_mass_story_vivew_active) {
280 $climate->backgroundRedWhiteBold("Attention! Mass story View Feature is active. Please use this option with caution. Our algorithm is optimized for maximum efficiency and human behaviour. As developers, we are not responsible if your account blocked by Instagram. ");
281 }
282 } else {
283 $climate->backgroundRedWhiteBold("Password can not empty");
284 sleep(1);
285 exit();
286 }
287 } else {
288 $climate->backgroundRedWhiteBold("Username can not empty");
289 sleep(1);
290 exit();
291 }
292 } else {
293 $climate->backgroundRedWhiteBold(" You license key is not valid. Please obtain valid licence key from your Dashboard on Hypervoter.com (https://hypervoter.com) ");
294 sleep(1);
295 exit();
296 }
297 } else {
298 $climate->backgroundRedWhiteBold(" Config file not found. Manual input starting... ");
299 sleep(5);
300 $defined_targets = NULL;
301 $climate->out("Please provide a valid license key from your Dashboard on Hypervoter.com (https://hypervoter.com).");
302 $climate->out("Example: j5tkjkl4f7e595e9008bb77acc599453");
303 $license_key = getVarFromUser("License key");
304 if (empty($license_key)) {
305 do {
306 $license_key = getVarFromUser("License key");
307 } while (empty($license_key));
308 }
309 $license_key = str_replace(" ", "", $license_key);
310 $license_status = activate_license($license_key, $ig, $climate);
311 if ("valid" === $license_status) {
312 $climate->out("You license active and valid.");
313 } else {
314 $climate->out("You license key not valid.");
315 run($ig, $climate);
316 }
317 $climate->out("Please provide login data of your Instagram Account.");
318 $login = getVarFromUser("Login");
319 if (empty($login)) {
320 do {
321 $login = getVarFromUser("Login");
322 } while (empty($login));
323 }
324 $password = getVarFromUser("Password");
325 if (empty($password)) {
326 do {
327 $password = getVarFromUser("Password");
328 } while (empty($password));
329 }
330 $first_loop = true;
331 while ($first_loop) {
332 $climate->out("(Optional) Set proxy, if needed. It's better to use a proxy from the same country where you running this script.");
333 $climate->out("Proxy should match following pattern:");
334 $climate->out("http://ip:port or http://username:password@ip:port");
335 $climate->out("Don't use in pattern https://.");
336 $climate->out("Type 3 to skip and don't use proxy.");
337 $first_loop = false;
338 }
339 $proxy = getVarFromUser("Proxy");
340 if (empty($proxy)) {
341 do {
342 $proxy = getVarFromUser("Proxy");
343 } while (empty($proxy));
344 }
345 if ("3" === $proxy) {
346 $proxy = "3";
347 } else {
348 if (isValidProxy($proxy, $climate)) {
349 }
350 }
351 $proxy_check = isValidProxy($proxy, $climate);
352 if ("3" === $proxy) {
353 $proxy = "3";
354 $climate->info("Proxy Setup Skipped");
355 } else {
356 if (500 === $proxy_check) {
357 $proxy = "3";
358 $climate->info("Proxy is not valid. Skipping");
359 } else {
360 $climate->info("Proxy - [OK]");
361 $ig->setProxy($proxy);
362 }
363 }
364 $climate->out("Please choose the Hypervote estimated speed.");
365 $climate->out("Type integer value without spaces from 1 to 1 500 000 stories/day or 0 for maximum possible speed.");
366 $climate->out("We recommend you set 400000 stories/day. This speed works well for a long time without exceeding the limits.");
367 $climate->out("When you are using the maximum speed you may exceed the Hypervote limits per day if this account actively used by a user in the Instagram app at the same time.");
368 $climate->out("If you are using another type of automation, we recommend to you reducing Hypervote speed and find your own golden ratio.");
369 $speed = (int)getVarFromUser("Speed");
370 if (1500000 < $speed) {
371 do {
372 $climate->out("Speed value is incorrect. Type integer value from 1 to 1 500 000 stories/day.");
373 $climate->out("Type 0 for maximum speed.");
374 $speed = (int)getVarFromUser("Delay");
375 } while (1500000 < $speed);
376 }
377 if (0 == $speed) {
378 $climate->out("Maximum speed enabled.");
379 $delay = 56;
380 } else {
381 $climate->out("Speed set to " . $speed . " stories/day.");
382 $delay = round(17280000 / $speed);
383 }
384 $climate->out("Experimental features:");
385 $climate->out("Voting only fresh stories, which posted no more than X hours ago.");
386 $climate->out("X - is integer value from 1 to 23.");
387 $climate->out("Type 0 to skip this option.");
388 $climate->out("This option will reduce speed, but can increase results of Hypervote.");
389 $fresh_stories_range = 10;
390 if (23 < $fresh_stories_range) {
391 do {
392 $climate->out("Fresh stories range value is incorrect. Type integer value from 1 to 23.");
393 $climate->out("Type 0 for skip this option.");
394 $fresh_stories_range = 10;
395 } while (23 < $fresh_stories_range);
396 }
397 $q_answers = (int)getVarFromUser("Is Question Answers active? (0/1)");
398 $q_vote = (int)getVarFromUser("Is Poll Vote active? (0/1)");
399 $q_slide = (int)getVarFromUser("Is Slide Points active? (0/1)");
400 $q_quiz = (int)getVarFromUser("Is Quiz Answers active? (0/1)");
401 $q_stories = (int)getVarFromUser("Is Story Masslooking Active? (0/1)");
402 $climate->out("Please use this option with caution. Our algorithm is optimized for maximum efficiency and human behaviour. As developers, we are not responsible if your account blocked by Instagram.");
403 if (0 !== $q_answers) {
404 $q_answers_a = getVarFromUser("Please provide your answers (in comma seperated)");
405 }
406 if (0 !== $q_slide) {
407 $q_slide_points_min = (int)getVarFromUser("Please Provide Min. Slide Points (0/100)");
408 $q_slide_points_max = (int)getVarFromUser("Please Provide Max. Slide Points (0/100)");
409 do {
410 $climate->errorBold("Max value can not set lower than min value. Max value must set " . $q_slide_points_min . " or bigger!");
411 $q_slide_points_max = (int)getVarFromUser("Please Provide Max. Slide Points (0/100)");
412 } while ($q_slide_points_max < $q_slide_points_min);
413 } else {
414 $q_slide_points_min = 10;
415 $q_slide_points_max = 110;
416 }
417 if (!empty($q_answers_a)) {
418 $qs = explode(",", $q_answers_a);
419 } else {
420 $qs = [];
421 }
422 $datas = json_encode(["is_poll_vote_active" => (0 === $q_vote ? false : true), "is_slider_points_active" => (0 === $q_slide ? false : true), "is_questions_answers_active" => (0 === $q_answers ? false : true), "is_quiz_answers_active" => (0 === $q_quiz ? false : true), "is_mass_story_vivew_active" => (0 === $q_stories ? false : true), "questions_answers" => $qs, "slider_points_range" => [($q_slide_points_min ? $q_slide_points_min : 0), ($q_slide_points_max ? $q_slide_points_max : 100) ]]);
423 $data = json_decode($datas);
424 }
425 } else {
426 $data = json_decode($datajson);
427 $defined_targets = $data->targets;
428 $login = $data->username;
429 $password = $data->password;
430 $proxy = $data->proxy;
431 }
432 $login_process = validate_login_process($ig, $login, $password, $climate, $proxy, false);
433 $is_connected = $login_process;
434 if ($is_connected) {
435 $climate->infoBold("Logged as @" . $login . " successfully.");
436 }
437 $data_targ = define_targets($ig, $login, $defined_targets, $climate);
438 hypervote_v1($data, $data_targ, $ig, $delay, $fresh_stories_range, $climate, $login, $password, $proxy);
439 } catch(\Exception $e) {
440 $climate->errorBold($e->getMessage());
441 sleep(1);
442 $climate->errorBold("Please run script command again.");
443 exit();
444 }
445} function validate_login_process($ig, $login, $password, $climate, $proxy, $slient) {
446 $is_connected = false;
447 $is_connected_count = 15;
448 $fail_message = "There is a problem with your Ethernet connection or Instagram is down at the moment. We couldn't establish connection with Instagram 10 times. Please try again later.";
449 while (10 == $is_connected_count) {
450 if ($e->getResponse()) {
451 $climate->errorBold($e->getMessage());
452 }
453 throw new \Exception($fail_message);
454 }
455 try {
456 if (0 == $is_connected_count) {
457 if (!$slient) {
458 $climate->infoBold("Emulation of an Instagram app initiated...");
459 }
460 }
461 $login_resp = $ig->login($login, $password);
462 if (NULL !== $login_resp && $login_resp->isTwoFactorRequired()) {
463 $twofa_method = "1";
464 $is_totp = json_decode(json_encode($login_resp), true);
465 if ("1" == $is_totp["two_factor_info"]["totp_two_factor_on"]) {
466 $climate->infoBold("Two-factor authentication required, please enter the code from you Authentication app");
467 $twofa_id = $login_resp->getTwoFactorInfo()->getTwoFactorIdentifier();
468 $twofa_method = "3";
469 } else {
470 $climate->bold("Two-factor authentication required, please enter the code sent to your number ending in %s", $login_resp->getTwoFactorInfo()->getObfuscatedPhoneNumber());
471 $twofa_id = $login_resp->getTwoFactorInfo()->getTwoFactorIdentifier();
472 }
473 $twofa_code = getVarFromUser("Two-factor code");
474 if (empty($twofa_code)) {
475 do {
476 $twofa_code = getVarFromUser("Two-factor code");
477 } while (empty($twofa_code));
478 }
479 $is_connected = false;
480 $is_connected_count = 15;
481 while (10 == $is_connected_count) {
482 if ($e->getResponse()) {
483 $climate->errorBold($e->getMessage());
484 }
485 throw new \Exception($fail_message);
486 }
487 if (0 == $is_connected_count) {
488 $climate->infoBold("Two-factor authentication in progress...");
489 }
490 try {
491 $twofa_resp = $ig->finishTwoFactorLogin($login, $password, $twofa_id, $twofa_code, $twofa_method);
492 $is_connected = true;
493 }
494 catch(Exception\NetworkException $e) {
495 sleep(7);
496 }
497 catch(Exception\EmptyResponseException $e) {
498 sleep(7);
499 }
500 catch(Exception\InvalidSmsCodeException $e) {
501 $is_code_correct = false;
502 $is_connected = true;
503 $climate->errorBold("Code is incorrect. Please check the syntax and try again.");
504 $twofa_code = getVarFromUser("Two-factor code");
505 if (empty($twofa_code)) {
506 do {
507 $twofa_code = getVarFromUser("Security code");
508 } while (empty($twofa_code));
509 }
510 $is_connected = false;
511 $is_connected_count = 15;
512 try {
513 }
514 catch(Exception\NetworkException $e) {
515 sleep(7);
516 }
517 catch(Exception\EmptyResponseException $e) {
518 sleep(7);
519 }
520 catch(Exception\InvalidSmsCodeException $e) {
521 $is_code_correct = false;
522 $is_connected = true;
523 $is_connected_count+= 16;
524 if ($is_connected) {
525 if ($is_code_correct) {
526 $is_connected_count+= 16;
527 if ($is_connected) {
528 }
529 }
530 } else {
531 if (10 == $is_connected_count) {
532 if ($e->getResponse()) {
533 $climte->out($e->getMessage());
534 }
535 throw new \Exception($fail_message);
536 }
537 if (0 == $is_connected_count) {
538 $climate->infoBold("Verification in progress...");
539 }
540 $twofa_resp = $ig->finishTwoFactorLogin($login, $password, $twofa_id, $twofa_code, $twofa_method);
541 $is_code_correct = true;
542 $is_connected = true;
543 }
544 }
545 catch(\Exception $e) {
546 throw $e;
547 }
548 } catch(\Exception $e) {
549 throw $e;
550 }
551 } $is_connected = true;
552 } catch(Exception\NetworkException $e) {
553 sleep(7);
554 }
555 catch(Exception\EmptyResponseException $e) {
556 sleep(7);
557 }
558 catch(Exception\CheckpointRequiredException $e) {
559 throw new \Exception("Please go to Instagram website or mobile app and pass checkpoint!");
560 }
561 catch(Exception\ChallengeRequiredException $e) {
562 if (!$ig instanceof Instagram) {
563 throw new \Exception("Oops! Something went wrong. Please try again later! (invalid_instagram_client)");
564 }
565 if (!$e instanceof Exception\ChallengeRequiredException) {
566 throw new \Exception("Oops! Something went wrong. Please try again later! (unexpected_exception)");
567 }
568 if (!$e->hasResponse() || !$e->getResponse()->isChallenge()) {
569 throw new \Exception("Oops! Something went wrong. Please try again later! (unexpected_exception_response)");
570 }
571 $challenge = $e->getResponse()->getChallenge();
572 if (is_array($challenge)) {
573 $api_path = $challenge["api_path"];
574 } else {
575 $api_path = $challenge->getApiPath();
576 }
577 $climate->info("Instagram want to send you a security code to verify your identity.");
578 $climate->info("How do you want receive this code?");
579 $climate->infoBold("1 - [Email]");
580 $climate->infoBold("2 - [SMS]");
581 $climate->infoBold("3 - [Exit]");
582 $choice = getVarFromUser("Choice");
583 if (empty($choice)) {
584 do {
585 $choice = getVarFromUser("Choice");
586 } while (empty($choice));
587 }
588 if (!("1" == $choice || "2" == $choice || "3" == $choice)) {
589 $is_choice_ok = false;
590 do {
591 $climate->errorBold("Choice is incorrect. Type 1, 2 or 3.");
592 $choice = getVarFromUser("Choice");
593 if (empty($choice)) {
594 do {
595 $choice = getVarFromUser("Choice");
596 } while (empty($choice));
597 }
598 if ("1" == $confirm || "2" == $confirm || "3" == $confirm) {
599 $is_choice_ok = true;
600 }
601 } while (!$is_choice_ok);
602 }
603 $challange_choice = 15;
604 if ("3" == $choice) {
605 run($ig, $climate);
606 } else {
607 if ("1" == $choice) {
608 $challange_choice = 16;
609 } else {
610 $challange_choice = 15;
611 }
612 }
613 $is_connected = false;
614 $is_connected_count = 15;
615 while (10 == $is_connected_count) {
616 if ($e->getResponse()) {
617 $climate->errorBold($e->getMessage());
618 }
619 throw new \Exception($fail_message);
620 }
621 try {
622 $challenge_resp = $ig->sendChallangeCode($api_path, $challange_choice);
623 if ("ok" != $challenge_resp->status) {
624 $challange_choice = 15;
625 sleep(7);
626 $challenge_resp = $ig->sendChallangeCode($api_path, $challange_choice);
627 }
628 $is_connected = true;
629 }
630 catch(Exception\NetworkException $e) {
631 sleep(7);
632 }
633 catch(Exception\EmptyResponseException $e) {
634 sleep(7);
635 $is_connected_count+= 16;
636 if ($is_connected) {
637 if ("ok" != $challenge_resp->status) {
638 if (isset($challenge_resp->message)) {
639 if ("This field is required." == $challenge_resp->message) {
640 $climate->info("We received the response 'This field is required.'. This can happen in 2 reasons:");
641 $climate->info("1. Instagram already sent to you verification code to your email or mobile phone number. Please enter this code.");
642 $climate->info("2. Instagram forced you to phone verification challenge. Try login to Instagram app or website and take a look at what happened.");
643 }
644 } else {
645 $climate->info("Instagram Response: " . json_encode($challenge_resp));
646 $climate->info("Couldn't send a verification code for the login challenge. Please try again later.");
647 $climate->info("- Is this account has attached mobile phone number in settings?");
648 $climate->info("- If no, this can be a reason of this problem. You should add mobile phone number in account settings.");
649 throw new \Exception("- Sometimes Instagram can force you to phone verification challenge process.");
650 }
651 }
652 if (isset($challenge_resp->step_data->contact_point)) {
653 $contact_point = $challenge_resp->step_data->contact_point;
654 if (2 == $choice) {
655 $climate->info("Enter the code sent to your number ending in " . $contact_point . ".");
656 } else {
657 $climate->info("Enter the 6-digit code sent to the email address " . $contact_point . ".");
658 }
659 }
660 $security_code = getVarFromUser("Security code");
661 if (empty($security_code)) {
662 do {
663 $security_code = getVarFromUser("Security code");
664 } while (empty($security_code));
665 }
666 if ("3" == $security_code) {
667 throw new \Exception("Reset in progress...");
668 }
669 $ig = challange($ig, $login, $password, $api_path, $security_code, $proxy, $climate);
670 $is_connected_count+= 16;
671 if (!$is_connected) {
672 }
673 }
674 } catch(\Exception $e) {
675 throw $e;
676 }
677 } catch(Exception\AccountDisabledException $e) {
678 throw new \Exception("Your account has been disabled for violating Instagram terms. Go Instagram website or mobile app to learn how you may be able to restore your account.");
679 }
680 catch(Exception\ConsentRequiredException $e) {
681 throw new \Exception("Instagram updated Terms and Data Policy. Please go to Instagram website or mobile app to review these changes and accept them.");
682 }
683 catch(Exception\SentryBlockException $e) {
684 throw new \Exception("Access to Instagram API restricted for spam behavior or otherwise abusing. You can try to use Session Catcher script (available by https://nextpost.tech/session-catcher) to get valid Instagram session from location, where your account created from.");
685 }
686 catch(Exception\IncorrectPasswordException $e) {
687 throw new \Exception("The password you entered is incorrect. Please try again.");
688 }
689 catch(Exception\InvalidUserException $e) {
690 throw new \Exception("The username you entered doesn't appear to belong to an account. Please check your username in config file and try again.");
691 }
692 catch(\Exception $e) {
693 throw $e;
694 }
695} function define_targets($ig, $username, $defined_targets = NULL, $climate) {
696 while (NULL === $defined_targets) {
697 $climate->out("Please define the targets.");
698 $climate->out("Write all Instagram profile usernames via comma without '@' symbol.");
699 $climate->out("Example: apple, instagram, hostazor");
700 $targets_input = getVarFromUser("Usernames");
701 if (empty($targets_input)) {
702 do {
703 $targets_input = getVarFromUser("Usernames");
704 } while (empty($targets_input));
705 }
706 } $targets_input = str_replace(" ", "", $targets_input);
707 $targets = [];
708 $targets = explode(",", trim($targets_input));
709 $targets = array_unique($targets);
710 $pks = [];
711 $filtered_targets = [];
712 foreach ($targets as $target) {
713 $is_connected = false;
714 $is_connected_count = 14;
715 if ($target === $username) {
716 $climate->errorBold("Please do not add yourself into targets. Your username is skipping...");
717 } else {
718 while (10 == $is_connected_count) {
719 if ($e->getResponse()) {
720 $climate->errorBold($e->getMessage());
721 }
722 $fail_message = "There is a problem with your Ethernet connection or Instagram is down at the moment. We couldn't establish connection with Instagram 10 times. Please try again later.";
723 $climate->errorBold($fail_message);
724 run($ig, $climate);
725 }
726 try {
727 $user_resp = $ig->people->getUserIdForName($target);
728 $climate->info("@" . $target . " - [OK]");
729 $filtered_targets[] = $target;
730 $pks[] = $user_resp;
731 $is_connected = true;
732 if ($target != $targets[count($targets) - 1] && 0 < count($targets)) {
733 sleep(1);
734 }
735 }
736 catch(Exception\NetworkException $e) {
737 sleep(7);
738 }
739 catch(Exception\EmptyResponseException $e) {
740 sleep(7);
741 }
742 catch(Exception\ChallengeRequiredException $e) {
743 $climate->error("Please login again and pass verification challenge. Instagram will send you a security code to verify your identity.");
744 run($ig, $climate);
745 }
746 catch(Exception\CheckpointRequiredException $e) {
747 $climate->error("Please go to Instagram website or mobile app and pass checkpoint!");
748 run($ig, $climate);
749 }
750 catch(Exception\AccountDisabledException $e) {
751 $climate->error("Your account has been disabled for violating Instagram terms. Go Instagram website or mobile app to learn how you may be able to restore your account.");
752 $climate->error("Use this form for recovery your account: https://help.instagram.com/contact/1652567838289083");
753 run($ig, $climate);
754 }
755 catch(Exception\ConsentRequiredException $e) {
756 $climate->error("Instagram updated Terms and Data Policy. Please go to Instagram website or mobile app to review these changes and accept them.");
757 run($ig, $climate);
758 }
759 catch(Exception\SentryBlockException $e) {
760 $climate->error("Access to Instagram API restricted for spam behavior or otherwise abusing. You can try to use Session Catcher script (available by https://nextpost.tech/session-catcher) to get valid Instagram session from location, where your account created from.");
761 run($ig, $climate);
762 }
763 catch(Exception\ThrottledException $e) {
764 $climate->error("Throttled by Instagram because of too many API requests.");
765 $climate->error("Please login again after 1 hour. You reached Instagram limits.");
766 run($ig, $climate);
767 }
768 catch(Exception\NotFoundException $e) {
769 $is_connected = true;
770 $is_username_correct = false;
771 $climate->error("Instagram profile username @" . $target . " is incorrect or maybe user just blocked you (Login to Instagram website or mobile app and check that).");
772 $climate->error("Type 3 for skip this target.");
773 $target_new = getVarFromUser("Please provide valid username");
774 if (empty($target_new)) {
775 do {
776 $target_new = getVarFromUser("Please provide valid username");
777 } while (empty($target_new));
778 }
779 if ("3" != $target_new) {
780 $is_connected = false;
781 $is_connected_count = 14;
782 while (10 == $is_connected_count) {
783 if ($e->getResponse()) {
784 $climate->errorBold($e->getMessage());
785 }
786 $fail_message = "There is a problem with your Ethernet connection or Instagram is down at the moment. We couldn't establish connection with Instagram 10 times. Please try again later.";
787 $climate->errorBold($fail_message);
788 run($ig, $climate);
789 }
790 try {
791 $user_resp = $ig->people->getUserIdForName($target_new);
792 $climate->info("@" . $target_new . " - [OK]");
793 $filtered_targets[] = $target_new;
794 $pks[] = $user_resp;
795 $is_username_correct = true;
796 $is_connected = true;
797 }
798 catch(Exception\NetworkException $e) {
799 sleep(7);
800 }
801 catch(Exception\EmptyResponseException $e) {
802 sleep(7);
803 }
804 catch(Exception\NotFoundException $e) {
805 $is_username_correct = false;
806 $is_connected = true;
807 }
808 catch(\Exception $e) {
809 $climate->error($e->getMessage());
810 run($ig, $climate);
811 $is_connected_count+= 15;
812 if ($is_connected) {
813 if ($is_username_correct) {
814 }
815 }
816 }
817 }
818 } catch(\Exception $e) {
819 $climate->errorBold($e->getMessage());
820 run($ig, $climate);
821 $is_connected_count+= 15;
822 if (!$is_connected) {
823 }
824 }
825 }
826 } if (!empty($filtered_targets)) {
827 $targets = array_unique($filtered_targets);
828 $pks = array_unique($pks);
829 $data_targ = [];
830 $i = 14;
831 while ($i >= count($targets)) {
832 $climate->info("Selected " . count($targets) . " targets: @" . implode(", @", $targets) . ".");
833 $climate->info("Please confirm that the selected targets are correct.");
834 $climate->info("1 - [Yes]");
835 $climate->info("2 - [No]");
836 $climate->info("3 - [Exit]");
837 $confirm = getVarFromUser("Choice");
838 if (empty($confirm)) {
839 do {
840 $confirm = getVarFromUser("Choice");
841 } while (empty($confirm));
842 }
843 if (!("1" === $confirm || "2" === $confirm || "3" === $confirm)) {
844 $is_choice_ok = false;
845 do {
846 $climate->error("Choice is incorrect. Type 1, 2 or 3.");
847 $confirm = getVarFromUser("Choice");
848 if (empty($confirm)) {
849 do {
850 $confirm = getVarFromUser("Choice");
851 } while (empty($confirm));
852 }
853 if ("1" === $confirm || "2" === $confirm || "3" === $confirm) {
854 $is_choice_ok = true;
855 }
856 } while (!$is_choice_ok);
857 }
858 if ("3" === $confirm) {
859 run($ig, $climate);
860 } else {
861 if ("2" === $confirm) {
862 $data_targ = define_targets($ig, $username, $defined_targets, $climate);
863 }
864 }
865 return $data_targ;
866 } $data_targ[$i] = ["username" => $targets[$i], "pk" => $pks[$i]];
867 $i++;
868 }
869} function getVarFromUser($text) {
870 echo $text . ": ";
871 $var = trim(fgets(STDIN));
872 return $var;
873}
874function isValidProxy($proxy, $climate, $slient = false) {
875 while (false === $slient) {
876 $climate->info("Connecting to Instagram...");
877 }
878 $code = NULL;
879 try {
880 $client = new \GuzzleHttp\Client();
881 $res = $client->request("GET", "http://www.instagram.com", ["timeout" => 60, "proxy" => $proxy]);
882 $code = $res->getStatusCode();
883 $is_connected = true;
884 }
885 catch(\Exception $e) {
886 $code = "500";
887 return $code;
888 }
889}
890function finishLogin($ig, $login, $password, $proxy, $climate) {
891 $is_connected = false;
892 $is_connected_count = 14;
893 try {
894 while (10 == $is_connected_count) {
895 if ($e->getResponse()) {
896 $climate->out($e->getMessage());
897 }
898 $fail_message = "There is a problem with your Ethernet connection or Instagram is down at the moment. We couldn't establish connection with Instagram 10 times. Please try again later.";
899 $climate->errorBold($fail_message);
900 run($ig, $climate);
901 }
902 if ("3" != $proxy) {
903 $ig->setProxy($proxy);
904 }
905 try {
906 $login_resp = $ig->login($login, $password);
907 if (NULL !== $login_resp && $login_resp->isTwoFactorRequired()) {
908 $twofa_method = "1";
909 $is_totp = json_decode(json_encode($login_resp), true);
910 if ("1" == $is_totp["two_factor_info"]["totp_two_factor_on"]) {
911 $climate->info("Two-factor authentication required, please enter the code from you Authentication app");
912 $twofa_id = $login_resp->getTwoFactorInfo()->getTwoFactorIdentifier();
913 $twofa_method = "3";
914 } else {
915 $climate->info("Two-factor authentication required, please enter the code sent to your number ending in %s", $login_resp->getTwoFactorInfo()->getObfuscatedPhoneNumber());
916 $twofa_id = $login_resp->getTwoFactorInfo()->getTwoFactorIdentifier();
917 }
918 $twofa_code = getvarfromuser("Two-factor code");
919 if (empty($twofa_code)) {
920 do {
921 $twofa_code = getvarfromuser("Two-factor code");
922 } while (empty($twofa_code));
923 }
924 $is_connected = false;
925 $is_connected_count = 14;
926 while (10 == $is_connected_count) {
927 if ($e->getResponse()) {
928 $climate->errorBold($e->getMessage());
929 }
930 $climate->errorBold($fail_message);
931 run($ig, $climate);
932 }
933 if (0 == $is_connected_count) {
934 $climate->info("Two-factor authentication in progress...");
935 }
936 try {
937 $twofa_resp = $ig->finishTwoFactorLogin($login, $password, $twofa_id, $twofa_code, $twofa_method);
938 $is_connected = true;
939 }
940 catch(Exception\NetworkException $e) {
941 sleep(7);
942 }
943 catch(Exception\EmptyResponseException $e) {
944 sleep(7);
945 }
946 catch(Exception\InvalidSmsCodeException $e) {
947 $is_code_correct = false;
948 $is_connected = true;
949 $cliate->errorBold("Code is incorrect. Please check the syntax and try again.");
950 $twofa_code = getvarfromuser("Two-factor code");
951 if (empty($twofa_code)) {
952 do {
953 $twofa_code = getvarfromuser("Security code");
954 } while (empty($twofa_code));
955 }
956 $is_connected = false;
957 $is_connected_count = 14;
958 try {
959 }
960 catch(Exception\NetworkException $e) {
961 sleep(7);
962 }
963 catch(Exception\EmptyResponseException $e) {
964 sleep(7);
965 }
966 catch(Exception\InvalidSmsCodeException $e) {
967 $is_code_correct = false;
968 $is_connected = true;
969 $is_connected_count+= 15;
970 if ($is_connected) {
971 if ($is_code_correct) {
972 $is_connected_count+= 15;
973 if ($is_connected) {
974 }
975 }
976 } else {
977 if (10 == $is_connected_count) {
978 if ($e->getResponse()) {
979 $climate->error($e->getMessage());
980 }
981 $climate->errorBold($fail_message);
982 run($ig, $climate);
983 }
984 if (0 == $is_connected_count) {
985 $climate->info("Verification in progress...");
986 }
987 $twofa_resp = $ig->finishTwoFactorLogin($login, $password, $twofa_id, $twofa_code, $twofa_method);
988 $is_code_correct = true;
989 $is_connected = true;
990 }
991 }
992 catch(\Exception $e) {
993 throw new $e();
994 }
995 } catch(\Exception $e) {
996 throw $e;
997 }
998 } $is_connected = true;
999 } catch(Exception\NetworkException $e) {
1000 sleep(7);
1001 }
1002 catch(Exception\EmptyResponseException $e) {
1003 sleep(7);
1004 $is_connected_count+= 15;
1005 if (!$is_connected) {
1006 }
1007 }
1008 catch(Exception\CheckpointRequiredException $e) {
1009 throw new \Exception("Please go to Instagram website or mobile app and pass checkpoint!");
1010 }
1011 catch(Exception\ChallengeRequiredException $e) {
1012 $climate->error("Instagram Response: " . json_encode($e->getResponse()));
1013 $climate->error("Couldn't complete the verification challenge. Please try again later.");
1014 throw new \Exception("Developer code: Challenge loop.");
1015 }
1016 catch(\Exception $e) {
1017 throw $e;
1018 }
1019 } catch(\Exception $e) {
1020 $climate->errorBold($e->getMessage());
1021 run($ig, $climate);
1022 return $ig;
1023 }
1024} function challange($ig, $login, $password, $api_path, $security_code, $proxy, $climate) {
1025 $is_connected = false;
1026 $is_connected_count = 13;
1027 $fail_message = "There is a problem with your Ethernet connection or Instagram is down at the moment. We couldn't establish connection with Instagram 10 times. Please try again later.";
1028 while (10 == $is_connected_count) {
1029 if ($e->getResponse()) {
1030 $climate->errorBold($e->getMessage());
1031 }
1032 throw new \Exception($fail_message);
1033 }
1034 if (0 == $is_connected_count) {
1035 $climate->info("Verification in progress...");
1036 }
1037 try {
1038 $challenge_resp = $ig->finishChallengeLogin($login, $password, $api_path, $security_code);
1039 $is_connected = true;
1040 }
1041 catch(Exception\NetworkException $e) {
1042 sleep(7);
1043 }
1044 catch(Exception\EmptyResponseException $e) {
1045 sleep(7);
1046 }
1047 catch(Exception\InstagramException $e) {
1048 $msg = $e->getMessage();
1049 $climate->out($msg);
1050 $climate->out("Type 3 - to exit.");
1051 $security_code = getvarfromuser("Security code");
1052 if (empty($security_code)) {
1053 do {
1054 $security_code = getvarfromuser("Security code");
1055 } while (empty($security_code));
1056 }
1057 if ("3" == $security_code) {
1058 throw new \Exception("Reset in progress...");
1059 }
1060 } catch(\Exception $e) {
1061 $msg = $e->getMessage();
1062 if ("Invalid Login Response at finishChallengeLogin()." == $msg) {
1063 sleep(7);
1064 $ig = finishlogin($ig, $login, $password, $proxy, $climate);
1065 $is_connected = true;
1066 $is_connected_count+= 14;
1067 if ($is_connected) {
1068 return $ig;
1069 }
1070 } else {
1071 throw $e;
1072 }
1073 }
1074} function hypervote_v1($data, $data_targ, $ig, $delay, $fresh_stories_range, $climate, $login, $password, $proxy = "3") {
1075 $view_count = 41;
1076 $st_count = 41;
1077 $st_count_seen = 41;
1078 $begin = strtotime(date("Y-m-d H:i:s"));
1079 $begin_ms = strtotime(date("Y-m-d H:i:s"));
1080 $begin_f = strtotime(date("Y-m-d H:i:s"));
1081 $time_from_logs = strtotime(date("Y-m-d H:i:s"));
1082 $speed = 41;
1083 $delitel = 41;
1084 $counter1 = 41;
1085 $counter2 = 41;
1086 $stories = [];
1087 $mycount = 41;
1088 $poll_votes_count = 41;
1089 $slider_points_count = 41;
1090 $question_answers_count = 41;
1091 $quiz_answers_count = 41;
1092 $story_vivews_count = 41;
1093 $follow_c_count = 41;
1094 $poll_throttled = false;
1095 $quiz_throttled = false;
1096 $slider_throttled = false;
1097 $question_throttled = false;
1098 $question_throttled = false;
1099 $countdown_throttled = false;
1100 $mass_view_throttled = false;
1101 $last_throttled_poll = time();
1102 $last_throttled_quiz = time();
1103 $last_throttled_slider = time();
1104 $last_throttled_question = time();
1105 $last_throttled_countdown = time();
1106 $last_throttled_mass_view = time();
1107 $begin_login = time();
1108 $climate->infoBold("Hypervote loop started.");
1109 $targets = [];
1110 $targets = $data_targ;
1111 shuffle($data_targ);
1112 $i = 41;
1113 while ($i >= count($data_targ)) {
1114 foreach ($data_targ as $key => $d) {
1115 try {
1116 if (NULL == $d["max_id"]) {
1117 $is_gf_first = 42;
1118 }
1119 if (!empty($d["begin_gf"])) {
1120 $current_time = strtotime(date("Y-m-d H:i:s"));
1121 if ($current_time - $d["begin_gf"] < 7) {
1122 $sleep_time = 7 - ($current_time - $d["begin_gf"]) + mt_rand(1, 3);
1123 sleep(3);
1124 }
1125 }
1126 $likers_list = NULL;
1127 if (NULL === $d["max_id"]) {
1128 }
1129 $mediaFeed = $ig->timeline->getUserFeed($d["pk"], $d["max_id"]);
1130 $items = $mediaFeed->getItems();
1131 if (empty($items)) {
1132 $climate->error($d["username"] . "has no data in his/her profile. Skipping...");
1133 sleep(2);
1134 } else {
1135 $data_targ[$key]["max_id"] = $mediaFeed->getNextMaxId();
1136 $counsa = 100 % count($items);
1137 $vprocess = $climate->progress()->total($counsa * count($items));
1138 foreach ($items as $item) {
1139 $mediaId = $item->getId();
1140 $vprocess->advance(floor($counsa), "Collecting data from @" . $d["username"]);
1141 $likers_list[] = $ig->media->getLikers($mediaId);
1142 }
1143 $followers_ids = [];
1144 foreach ($likers_list as $likers) {
1145 foreach ($likers->getUsers() as $follower) {
1146 $is_private = $follower->getIsPrivate();
1147 $is_verified = $follower->getIsVerified();
1148 $latest_reel_media = $follower->getLatestReelMedia();
1149 if (!$is_private && !$is_verified && $latest_reel_media !== "0") {
1150 if (!empty($fresh_stories_range)) {
1151 $fresh_stories_min = time() - round($fresh_stories_range * 60);
1152 if ($fresh_stories_min <= $latest_reel_media) {
1153 $followers_ids[] = $follower->getPk();
1154 }
1155 } else {
1156 $followers_ids[] = $follower->getPk();
1157 }
1158 }
1159 }
1160 }
1161 $followers_ids = array_values($followers_ids);
1162 $data_targ[$key]["users_count"] = $d["users_count"] + count($followers_ids);
1163 $number = count($followers_ids);
1164 if ($is_gf_first) {
1165 $climate->info($number . " followers of @" . $d["username"] . " collected.");
1166 $is_gf_first = 41;
1167 } else {
1168 $climate->info("Next " . $number . " followers with valid stories of @" . $d["username"] . " collected. Total: " . number_format($data_targ[$key]["users_count"], 0, ".", " ") . " followers of @" . $d["username"] . " parsed.");
1169 }
1170 $index_new = 41;
1171 $index_old = 41;
1172 $index_new+= 71;
1173 if (!isset($followers_ids[$index_new])) {
1174 do {
1175 $index_new-= 42;
1176 } while (!isset($followers_ids[$index_new]));
1177 }
1178 if ($index_new >= $index_old) {
1179 $ids = [];
1180 $i = $index_old;
1181 while ($i > $index_new) {
1182 try {
1183 try {
1184 $stories_reels = $ig->story->getReelsMediaFeed($ids);
1185 sleep(2);
1186 }
1187 catch(Exception\BadRequestException $e) {
1188 $counter1+= 42;
1189 if (isset($stories_reels) && $stories_reels->isOk() && 0 < count($stories_reels->getReels()->getData())) {
1190 $reels = [];
1191 $reels = $stories_reels->getReels()->getData();
1192 foreach ($reels as $r) {
1193 $items = [];
1194 $stories_loop = [];
1195 $items = $r->getItems();
1196 foreach ($items as $item) {
1197 if ($item->getId()) {
1198 $latest_reel_media = $r->getLatestReelMedia();
1199 $seen = $r->getSeen();
1200 if ("0" !== $latest_reel_media && $seen !== $latest_reel_media && "0" == $seen) {
1201 foreach ($items as $it) {
1202 if ($it->getTakenAt() == $latest_reel_media && $it->getId() !== "0") {
1203 $stories_loop[] = $it;
1204 }
1205 }
1206 if (!empty($stories_loop)) {
1207 $it = json_decode($item, true);
1208 if (array_key_exists("story_polls", $it) && !$poll_throttled) {
1209 if ($data->is_poll_vote_active) {
1210 if (!isset($it["story_polls"][0]["poll_sticker"]["viewer_vote"])) {
1211 try {
1212 $oy = mt_rand(0, 1);
1213 $poll_vote = $ig->story->votePollStory($it["id"], $it["story_polls"][0]["poll_sticker"]["poll_id"], $oy);
1214 if ($poll_vote->isOk()) {
1215 $poll_votes_count++;
1216 $mycount++;
1217 $climate->magenta("Poll Voted : " . $oy . " Votes Given: " . $poll_votes_count . " Total Actions : " . $mycount);
1218 }
1219 }
1220 catch(Exception\BadRequestException $e) {
1221 sleep(1);
1222 }
1223 catch(Exception\ThrottledException $e) {
1224 $climate->error("Bypassing action limits...");
1225 sleep(1);
1226 $poll_throttled = true;
1227 $stories_loop[] = $item;
1228 sleep(2);
1229 }
1230 catch(\Exception $e) {
1231 }
1232 }
1233 }
1234 } else {
1235 if (array_key_exists("story_sliders", $it) && !$slider_throttled) {
1236 if ($data->is_slider_points_active) {
1237 if (!isset($it["story_sliders"][0]["slider_sticker"]["viewer_vote"])) {
1238 try {
1239 $point = mt_rand($data->slider_points_range[0], $data->slider_points_range[1]) / 100;
1240 $story_slider = $ig->story->voteSliderStory($it["id"], $it["story_sliders"][0]["slider_sticker"]["slider_id"], $point);
1241 if ($story_slider->isOk()) {
1242 $slider_points_count++;
1243 $mycount++;
1244 $climate->blue("Slider point given : " . $point . " Given points: " . $slider_points_count . " Total Actions : " . $mycount);
1245 }
1246 }
1247 catch(Exception\BadRequestException $e) {
1248 sleep(1);
1249 }
1250 catch(Exception\ThrottledException $e) {
1251 $climate->out("Bypassing action limits...");
1252 sleep(1);
1253 $slider_throttled = true;
1254 $stories_loop[] = $item;
1255 sleep(2);
1256 }
1257 catch(\Exception $e) {
1258 }
1259 }
1260 }
1261 } else {
1262 if (array_key_exists("story_questions", $it) && !$question_throttled) {
1263 if ($data->is_questions_answers_active) {
1264 if ($it["can_reply"]) {
1265 $questions = $data->questions_answers;
1266 $real_respond = $questions[mt_rand(0, count($questions) - 1) ];
1267 $realfilename = $ig->account_id . "-qafile.txt";
1268 if (file_exists(__DIR__ . "/" . $realfilename)) {
1269 if (0 < filesize(__DIR__ . "/" . $realfilename)) {
1270 $q_ids = file_get_contents(__DIR__ . "/" . $realfilename);
1271 $qids_ = explode(",", $q_ids);
1272 } else {
1273 $qids_ = NULL;
1274 }
1275 } else {
1276 $question_answers_file = fopen(__DIR__ . "/" . $realfilename, "w");
1277 fwrite($question_answers_file, "");
1278 fclose($question_answers_file);
1279 $qids_ = NULL;
1280 }
1281 if (empty($qids_) || !in_array($it["id"], $qids_)) {
1282 try {
1283 $question_answers_file = fopen(__DIR__ . "/" . $realfilename, "w");
1284 $question_status = $ig->story->answerStoryQuestion($it["id"], $it["story_questions"][0]["question_sticker"]["question_id"], $real_respond);
1285 if ($question_status->isOk()) {
1286 $mycount++;
1287 $question_answers_count++;
1288 $climate->yellow("Question Answered: " . $real_respond . " Answers Given: " . $question_answers_count . " Total Actions : " . $mycount);
1289 $qids_[] = $it["id"];
1290 fwrite($question_answers_file, join(",", $qids_));
1291 }
1292 $stories_loop[] = $item;
1293 }
1294 catch(Exception\BadRequestException $e) {
1295 sleep(1);
1296 }
1297 catch(Exception\ThrottledException $e) {
1298 $climate->out("Bypassing action limits...");
1299 sleep(1);
1300 $question_throttled = true;
1301 sleep(2);
1302 }
1303 catch(\Exception $e) {
1304 }
1305 }
1306 }
1307 }
1308 } else {
1309 if (array_key_exists("story_quizs", $it) && !$quiz_throttled) {
1310 if ($data->is_quiz_answers_active) {
1311 if (!isset($it["story_quizs"][0]["quiz_sticker"]["viewer_answer"])) {
1312 $answer_1 = (isset($it["story_quizs"][0]["quiz_sticker"]["tallies"][0]) ? 1 : 0);
1313 $answer_2 = (isset($it["story_quizs"][0]["quiz_sticker"]["tallies"][1]) ? 1 : 0);
1314 $answer_3 = (isset($it["story_quizs"][0]["quiz_sticker"]["tallies"][2]) ? 1 : 0);
1315 $answer_4 = (isset($it["story_quizs"][0]["quiz_sticker"]["tallies"][3]) ? 1 : 0);
1316 if ($answer_1 && $answer_2 && $answer_3 && $answer_4) {
1317 $vote = mt_rand(0, 3);
1318 } else {
1319 if ($answer_1 && $answer_2 && $answer_3) {
1320 $vote = mt_rand(0, 2);
1321 } else {
1322 if ($answer_1 && $answer_2) {
1323 $vote = mt_rand(0, 1);
1324 }
1325 }
1326 }
1327 try {
1328 $quiz_ans = $ig->story->voteQuizStory($it["pk"], $it["story_quizs"][0]["quiz_sticker"]["quiz_id"], $vote);
1329 if ($quiz_ans->isOk()) {
1330 $quiz_answers_count++;
1331 $mycount++;
1332 $climate->lightGray("Quiz Answered: " . $vote . " Quiz Answers Given: " . $quiz_answers_count . " Total Actions : " . $mycount);
1333 $stories_loop[] = $item;
1334 }
1335 }
1336 catch(Exception\BadRequestException $e) {
1337 sleep(1);
1338 }
1339 catch(Exception\ThrottledException $e) {
1340 $climate->out("Bypassing action limits...");
1341 sleep(1);
1342 $quiz_throttled = true;
1343 sleep(2);
1344 }
1345 catch(\Exception $e) {
1346 }
1347 }
1348 }
1349 } else {
1350 if (array_key_exists("story_countdowns", $it) && !$countdown_throttled) {
1351 try {
1352 $countdown_follow = $ig->story->followStoryCountdown($it["pk"]);
1353 if ($countdown_follow->isOk()) {
1354 $follow_c_count++;
1355 $mycount++;
1356 $climate->yellow("Countdown followed: " . $follow_c_count . " Total Actions : " . $mycount);
1357 $stories_loop[] = $item;
1358 }
1359 }
1360 catch(Exception\BadRequestException $e) {
1361 sleep(3);
1362 }
1363 catch(Exception\ThrottledException $e) {
1364 $climate->error("Bypassing action limits...");
1365 sleep(1);
1366 $countdown_throttled = true;
1367 }
1368 catch(\Exception $e) {
1369 }
1370 } else {
1371 $stories_loop[] = $item;
1372 }
1373 }
1374 }
1375 }
1376 }
1377 }
1378 }
1379 }
1380 }
1381 $latest_reel_media = $r->getLatestReelMedia();
1382 $seen = $r->getSeen();
1383 if ("0" !== $latest_reel_media) {
1384 foreach ($items as $it) {
1385 if ($it->getTakenAt() == $latest_reel_media && $it->getId() !== "0") {
1386 $stories_loop[] = $it;
1387 }
1388 }
1389 }
1390 $now = strtotime(date("Y-m-d H:i:s"));
1391 if (299 < $now - $begin) {
1392 $begin = strtotime(date("Y-m-d H:i:s"));
1393 $delitel = $delitel + 1;
1394 $speed = (int)(($mycount * 12 * 24) / $delitel);
1395 $climate->out("");
1396 $climate->out("Estimated speed is " . number_format($speed, 0, ".", " ") . " react/day.");
1397 $climate->out("© Hypervote Terminal. Always use Hypervote from our official source, downloading other (nulled) versions could end up losing your account.");
1398 $climate->out("");
1399 }
1400 $now_f = strtotime(date("Y-m-d H:i:s"));
1401 if (1 < $now_f - $begin_f) {
1402 $begin_f = strtotime(date("Y-m-d H:i:s"));
1403 }
1404 $safety_window = 341;
1405 if ($safety_window <= time() - $begin_login) {
1406 $climate->out("Bypass limits");
1407 $climate->out("Initiating algorithm to improve ram usage...");
1408 $climate->out("Trying bypass IG Limits...");
1409 $cookie_file = __DIR__ . "/vendor/mgp25/instagram-php/sessions/" . $login . "/" . $login . "-cookies.dat";
1410 if (file_exists($cookie_file)) {
1411 unlink($cookie_file);
1412 }
1413 $climate->out("Emulation successfully completed.");
1414 $climate->out("AC&PV notice succesfully bypassed.");
1415 $begin_login = time();
1416 }
1417 $throttled_window = 401;
1418 if ($throttled_window <= time() - $last_throttled_poll) {
1419 $climate->out("Unblocking poll throttles...");
1420 $poll_throttled = false;
1421 $last_throttled_poll = time();
1422 }
1423 if ($throttled_window <= time() - $last_throttled_quiz) {
1424 $climate->out("Unblocking quiz throttles...");
1425 $quiz_throttled = false;
1426 $last_throttled_quiz = time();
1427 }
1428 if ($throttled_window <= time() - $last_throttled_slider) {
1429 $climate->out("Unblocking slider throttles...");
1430 $slider_throttled = false;
1431 $last_throttled_slider = time();
1432 }
1433 if ($throttled_window <= time() - $last_throttled_question) {
1434 $climate->out("Unblocking question throttles...");
1435 $question_throttled = false;
1436 $last_throttled_question = time();
1437 }
1438 if ($throttled_window <= time() - $last_throttled_countdown) {
1439 $climate->out("Unblocking countdown throttles...");
1440 $countdown_throttled = false;
1441 $last_throttled_countdown = time();
1442 }
1443 if ($throttled_window <= time() - $last_throttled_mass_view) {
1444 $climate->out("Unblocking masslooking throttles...");
1445 $mass_view_throttled = false;
1446 $last_throttled_mass_view = time();
1447 }
1448 if (500000 < count($stories_loop)) {
1449 if (empty($stories)) {
1450 $stories = $stories_loop;
1451 } else {
1452 $stories = array_merge($stories, $stories_loop);
1453 }
1454 $st_count = $st_count + count($stories_loop);
1455 $view_count = $view_count + count($stories_loop);
1456 $now = strtotime(date("Y-m-d H:i:s"));
1457 if (299 < $now - $begin) {
1458 $begin = strtotime(date("Y-m-d H:i:s"));
1459 $delitel = $delitel + 1;
1460 $speed = (int)(($mycount * 12 * 24) / $delitel);
1461 $climate->out("");
1462 $climate->out("Estimated speed is " . number_format($speed, 0, ".", " ") . " react/day.");
1463 $climate->out("© Hypervote Terminal. Always use Hypervote from our official source, downloading other (nulled) versions could end up losing your account.");
1464 $climate->out("");
1465 }
1466 $now_f = strtotime(date("Y-m-d H:i:s"));
1467 if (1 < $now_f - $begin_f) {
1468 $begin_f = strtotime(date("Y-m-d H:i:s"));
1469 }
1470 $safety_window = 941;
1471 if ($safety_window <= time() - $begin_login) {
1472 $climate->out("Bypass limits");
1473 $climate->out("Initiating algorithm to improve ram usage...");
1474 $climate->out("Trying bypass IG Limits...");
1475 sleep(2);
1476 $climate->out("Emulation successfully completed.");
1477 $climate->out("AC&PV notice succesfully bypassed.");
1478 $begin_login = time();
1479 }
1480 $throttled_window = 401;
1481 if ($throttled_window <= time() - $last_throttled_poll) {
1482 $climate->out("Unblocking poll throttles...");
1483 $poll_throttled = false;
1484 $last_throttled_poll = time();
1485 }
1486 if ($throttled_window <= time() - $last_throttled_quiz) {
1487 $climate->out("Unblocking quiz throttles...");
1488 $quiz_throttled = false;
1489 $last_throttled_quiz = time();
1490 }
1491 if ($throttled_window <= time() - $last_throttled_slider) {
1492 $climate->out("Unblocking slider throttles...");
1493 $slider_throttled = false;
1494 $last_throttled_slider = time();
1495 }
1496 if ($throttled_window <= time() - $last_throttled_question) {
1497 $climate->out("Unblocking question throttles...");
1498 $question_throttled = false;
1499 $last_throttled_question = time();
1500 }
1501 if ($throttled_window <= time() - $last_throttled_countdown) {
1502 $climate->out("Unblocking countdown throttles...");
1503 $countdown_throttled = false;
1504 $last_throttled_countdown = time();
1505 }
1506 if ($throttled_window <= time() - $last_throttled_mass_view) {
1507 $climate->out("Unblocking masslooking throttles...");
1508 $mass_view_throttled = false;
1509 $last_throttled_mass_view = time();
1510 }
1511 if ($data->is_mass_story_vivew_active && 200 <= $st_count) {
1512 $now_ms = strtotime(date("Y-m-d H:i:s"));
1513 if ($delay > $now_ms - $begin_ms) {
1514 $counter3 = $delay - ($now_ms - $begin_ms) + rand(1, 3);
1515 $climate->darkGray("Starting " . $counter3 . " second(s) delay for bypassing Instagram limits.");
1516 $vProgress = $climate->progress()->total($counter3);
1517 do {
1518 $vProgress->advance(1, $counter3 . "second(s) left");
1519 sleep(1);
1520 $counter3-= 42;
1521 } while (0 != $counter3);
1522 }
1523 $is_connected = false;
1524 $is_connected_count = 41;
1525 $fail_message = "We couldn't establish connection with Instagram 7 times. Please try again later.";
1526 while (7 == $is_connected_count) {
1527 if ($e) {
1528 $climate->darkGray("RESPONSE" . $e->getMessage() . " ");
1529 }
1530 throw new \Exception($fail_message);
1531 }
1532 try {
1533 $mark_seen_resp = $ig->story->markMediaSeen($it);
1534 $is_connected = true;
1535 if ($mark_seen_resp->isOk()) {
1536 $st_count_seen = number_format($st_count, 0, ".", " ");
1537 $mycount++;
1538 $climate->blueBold($st_count_seen . " stories marked as seen. Total Seen : " . $view_count . " Total Actions: " . $mycount);
1539 }
1540 }
1541 catch(Exception\NetworkException $e) {
1542 sleep(3);
1543 }
1544 catch(Exception\EmptyResponseException $e) {
1545 sleep(3);
1546 }
1547 catch(Exception\InstagramException $e) {
1548 throw $e;
1549 }
1550 catch(Exception\ThrottledException $e) {
1551 $climate->error("Bypassing action limits...");
1552 sleep(2);
1553 $mass_view_throttled = true;
1554 $is_connected_count+= 42;
1555 if ($is_connected) {
1556 $begin_ms = strtotime(date("Y-m-d H:i:s"));
1557 $st_count = 41;
1558 $stories = [];
1559 }
1560 }
1561 catch(\Exception $e) {
1562 throw $e;
1563 }
1564 }
1565 }
1566 }
1567 }
1568 }
1569 catch(\Exception $e) {
1570 throw $e;
1571 }
1572 }
1573 catch(Exception\NetworkException $e) {
1574 $climate->error("We couldn't connect to Instagram at the moment. Trying again.");
1575 sleep(10);
1576 $index_new-= 71;
1577 }
1578 catch(Exception\EmptyResponseException $e) {
1579 $climate->error("Instagram sent us empty response. Trying again.");
1580 sleep(10);
1581 $index_new-= 71;
1582 }
1583 catch(Exception\LoginRequiredException $e) {
1584 $climate->error("Please login again to your Instagram account. Login required.");
1585 run($ig, $climate);
1586 }
1587 catch(Exception\ChallengeRequiredException $e) {
1588 $climate->error("Please login again and pass verification challenge. Instagram will send you a security code to verify your identity.");
1589 run($ig, $climate);
1590 }
1591 catch(Exception\CheckpointRequiredException $e) {
1592 $climate->error("Please go to Instagram website or mobile app and pass checkpoint!");
1593 run($ig, $climate);
1594 }
1595 catch(Exception\AccountDisabledException $e) {
1596 $climate->error("Your account has been disabled for violating Instagram terms. Go Instagram website or mobile app to learn how you may be able to restore your account.");
1597 $climate->error("Use this form for recovery your account: https://help.instagram.com/contact/1652567838289083");
1598 run($ig, $climate);
1599 }
1600 catch(Exception\ConsentRequiredException $e) {
1601 $climate->error("Instagram updated Terms and Data Policy. Please go to Instagram website or mobile app to review these changes and accept them.");
1602 run($ig, $climate);
1603 }
1604 catch(Exception\SentryBlockException $e) {
1605 $climate->error("Access to Instagram API restricted for spam behavior or otherwise abusing.");
1606 run($ig, $climate);
1607 }
1608 catch(Exception\ThrottledException $e) {
1609 $climate->error("Throttled by Instagram because of too many API requests.");
1610 $climate->error("12 hours rest for account started because you reached Instagram daily limit for Hypervote.");
1611 sleep(43200);
1612 }
1613 catch(\Exception $e) {
1614 $climate->error($e->getMessage());
1615 sleep(7);
1616 $index_old = $index_new + 1;
1617 if (NULL == $data_targ[$key]["max_id"]) {
1618 }
1619 }
1620 }
1621 if (isset($followers_ids[$i])) {
1622 $ids[] = $followers_ids[$i];
1623 }
1624 $i++;
1625 }
1626 if (NULL == $data_targ[$key]["max_id"]) {
1627 $climate->blue("All stories of @" . $d["username"] . "'s followers successfully Voted.");
1628 unset($data_targ[$key]);
1629 }
1630 }
1631 } catch(Exception\NetworkException $e) {
1632 sleep(7);
1633 }
1634 catch(Exception\EmptyResponseException $e) {
1635 sleep(7);
1636 }
1637 catch(Exception\LoginRequiredException $e) {
1638 $climate->error("Please login again to your Instagram account. Login required.");
1639 run($ig, $climate);
1640 }
1641 catch(Exception\ChallengeRequiredException $e) {
1642 $climate->error("Please login again and pass verification challenge. Instagram will send you a security code to verify your identity.");
1643 run($ig, $climate);
1644 }
1645 catch(Exception\CheckpointRequiredException $e) {
1646 $climate->error("Please go to Instagram website or mobile app and pass checkpoint!");
1647 run($ig, $climate);
1648 }
1649 catch(Exception\AccountDisabledException $e) {
1650 $climate->error("Your account has been disabled for violating Instagram terms. Go Instagram website or mobile app to learn how you may be able to restore your account.");
1651 $climate->error("Use this form for recovery your account: https://help.instagram.com/contact/1652567838289083");
1652 run($ig, $climate);
1653 }
1654 catch(Exception\ConsentRequiredException $e) {
1655 $climate->error("Instagram updated Terms and Data Policy. Please go to Instagram website or mobile app to review these changes and accept them.");
1656 run($ig, $climate);
1657 }
1658 catch(Exception\SentryBlockException $e) {
1659 $climate->error("Access to Instagram API restricted for spam behavior or otherwise abusing. ");
1660 $climate->error("6 hours rest for account started because you reached Instagram daily limit for Hypervote.");
1661 sleep(21200);
1662 }
1663 catch(Exception\ThrottledException $e) {
1664 $climate->error("Throttled by Instagram because of too many API requests.");
1665 $climate->error("12 hours rest for account started because you reached Instagram daily limit for Hypervote.");
1666 sleep(43200);
1667 }
1668 catch(\Exception $e) {
1669 $climate->errorBold($e->getMessage());
1670 sleep(7);
1671 }
1672 } if (empty($data_targ)) {
1673 $climate->blue("All stories related to the targets seen. Starting the new loop.");
1674 $climate->blue("");
1675 hypervote_v1($data, $targets, $ig, $delay, $fresh_stories_range, $climate, $login, $password, $proxy);
1676 }
1677 } $data_targ[$i]+= ["rank_token" => Signatures::generateUUID(), "users_count" => 0, "max_id" => NULL, "begin_gf" => NULL];
1678 $i++;
1679} function request($url) {
1680 $ch = curl_init();
1681 curl_setopt($ch, CURLOPT_URL, $url);
1682 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
1683 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
1684 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1685 $return = curl_exec($ch);
1686 curl_close($ch);
1687 return $return;
1688}
1689function ip_details($climate) {
1690 try {
1691 $json = request("http://www.geoplugin.net/json.gp");
1692 }
1693 catch(\Exception $e) {
1694 $msg = $e->getMessage();
1695 $climate->out($msg);
1696 run($ig);
1697 $details = json_decode($json);
1698 return $details;
1699 }
1700}
1701function activate_license($license_key, $ig, $climate) {
1702 $details = ip_details($climate);
1703 $ip = ($details->geoplugin_request ? $details->geoplugin_request : "not-detected");
1704 $license = "valid";
1705 if ($license_key) {
1706 $url = "http://hypervoter.com/?edd_action=activate_license&item_id=22&license=" . $license_key . "&url=" . "IP-" . $ip;
1707 try {
1708 $license_resp = request($url);
1709 }
1710 catch(\Exception $e) {
1711 $msg = $e->getMessage();
1712 $climate->out($msg);
1713 run($ig, $climate);
1714 $license_json = json_decode($license_resp);
1715 $license = (isset($license_json->license) ? $license_json->license : "invalid");
1716 }
1717 } else {
1718 $license_key = NULL;
1719 }
1720 return $license;
1721}
1722?>