-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
141 lines (99 loc) · 4.5 KB
/
app.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
const prompt = require('prompt-sync')({sigint: true});
const puppeteer = require('puppeteer')
const colors = require('colors');
const dialog = require('dialog');
const setTitle = require('node-bash-title');
setTitle("💻 Discord Invite Checker 📱 - Scr1pp3d");
var errorText = 'ERROR: '.red + 'An error occcured.'.white + "\n" + 'CTRL + C to quit.';
function displayName() {
process.stdout.write('\033c');
console.log()
console.log(' █▀▄ █ █▀ █▀▀ █▀█ █▀█ █▀▄ █ █▄░█ █░█ █ ▀█▀ █▀▀ █▀▀ █░█ █▀▀ █▀▀ █▄▀ █▀▀ █▀█'.brightCyan)
console.log(' █▄▀ █ ▄█ █▄▄ █▄█ █▀▄ █▄▀ █ █░▀█ ▀▄▀ █ ░█░ ██▄ █▄▄ █▀█ ██▄ █▄▄ █░█ ██▄ █▀▄ '.brightBlue)
console.log(' By Scr1pp3d'.white)
console.log(' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'.white)
console.log()
}
displayName()
prompt('Press any key to start: ')
requestUrls()
function requestUrls() {
displayName()
var urls = prompt('Enter invite links (right click to paste): ')
if (!urls.includes('http')) {
requestUrls()
}
else if (!urls.includes('discord')) {
requestUrls()
}
else if (urls.includes('discord.com') && !urls.includes('invite')) {
requestUrls()
}
else {
if (urls.includes("\r")) {
var urls = urls.split("\r").join("\n")
var urls = urls.replace(/\n/g, ',')
var urls = urls.split(',')
urls.unshift('')
}
else if (urls.includes('http') && !urls.includes(', ')) {
var urls = urls.replace(/http/g, ', http');
var urls = urls.replace(/, /g, ',');
var urls = urls.replace(/ /g, '');
var urls = urls.split(',')
}
else if (urls.includes('http') && urls.includes(', ')) {
var urls = urls.replace(/, http/g, ',http');
var urls = urls.split(',')
urls.unshift('')
}
checkDiscordInvite().catch(error => {
console.log()
console.log(errorText)
});
//console.log(urls)
}
var ValidLinks = 0;
var InvalidLinks = 0;
async function checkDiscordInvite() {
const browser = await puppeteer.launch({ executablePath: './chromium/win64-884014/chrome-win/chrome.exe', headless: true});
const page = await browser.newPage()
for (let i = 1; i < urls.length; i++) {
const url = urls[i];
page.goto(url);
await page.waitForNavigation();
await page.waitForSelector('h3.title-jXR8lp')
await page.waitForSelector('.colorHeaderSecondary-3Sp3Ft')
var validityText = await eval(`page.evaluate(() => {
return document.querySelector('h3.title-jXR8lp').textContent;
})`);
var classL = await eval(`page.evaluate(() => {
return document.querySelector('h3.title-jXR8lp').classList.toString();
})`);
console.log()
if (!classL.includes('title-2_aCTw')) {
console.log('[INVALID INVITE] '.red + url)
console.log()
InvalidLinks++
}
else {
console.log('[VALID INVITE] '.green + url)
console.log('SERVER NAME: ' + validityText.white)
console.log()
ValidLinks++
}
}
dialog.info('Found ' + ValidLinks + ' valid link(s) and ' + InvalidLinks + ' invalid link(s).')
prompt('Press any key to quit: ')
await browser.close()
}
}
/*
examples:
https://discord.com/invite/WDS3cSXrHF https://discord.com/invite/NgDBtKcWzD
https://discord.com/invite/WDS3cSXrHF, https://discord.com/invite/NgDBtKcWzD
https://discord.com/invite/WDS3cSXrHF
https://discord.com/invite/NgDBtKcWzD
https://discord.com/invite/WDS3cSXrHF\r
https://discord.com/invite/NgDBtKcWzD
*/