forked from MokuMoki/PopHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopcat_bot.js
More file actions
46 lines (42 loc) · 1.6 KB
/
popcat_bot.js
File metadata and controls
46 lines (42 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
1 - Open "popcat.click" website.
2 - Open Console (Ctrl + Shift + I).
3 - Copy from line 9 to 46, paste in Console and press Enter to run.
Additional info: https://github.com/MokuMoki/popcat_bot
*/
var vue = document.getElementById('app').__vue__;
let total = 0, error = 0, token = '';
const count = 800;
console.clear();
console.log("%cYour bot have started.", "color: #ff77ff");
setInterval(async () => {
vue.interval = false;
await vue.$recaptchaLoaded();
const recaptchaResponseToken = await vue.$recaptcha('pop');
token = token ? `&token=${token}` : '';
let url = `https://stats.popcat.click/pop?pop_count=${count}&captcha_token=${recaptchaResponseToken}${token}`;
const res = await fetch(url, {
method: "POST",
mode: "cors",
});
switch (res.status) {
case 201:
const data = await res.json();
token = data.Token ? data.Token : token;
total += count;
error = 0;
console.log(`%cSuccessfully sent ${count} pops!You sent ${total} pops in total!(Country:${data.Location.Name})`, "color: #6ea561");
break;
case 429:
console.log("%cRespond too frequent, please wait at least 30 seconds.", "color: #fbb40c");
break;
case 503:
error++;
if (error < 10) {
console.log("%cThere is an issue. Retrying...", "color: #fbb40c");
} else {
console.log("%cYour IP/device is blacklisted by CloudFlare, please wait for 12 hours.", "color: #de2910");
}
break;
}
}, 30000);