-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
47 lines (43 loc) · 1.59 KB
/
main.py
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
import requests
from tkinter import *
from tkinter.filedialog import *
from colorama import init
from termcolor import colored
init()
vcounter = 0
icounter = 0
print("Select the text file containing the tokens to check...")
Tk().withdraw()
token = askopenfilename()
with open(token) as handle:
txtf = handle.read()
f = open("tokens.txt","a")
f.write("\n" + txtf)
f.close()
print ("Checking tokens...")
with open('tokens.txt','r') as handle:
tokens = handle.readlines()
for x in tokens:
token = x.rstrip()
headers={
'Authorization': token
}
src = requests.get('https://discordapp.com/api/v6/auth/login', headers=headers)
try:
if src.status_code == 200:
print (colored(token + ' Valid.',"green"))
vcounter +=1
with open('valid.txt','a') as handle:
handle.write(token + '\n')
else:
print(colored(token + ' Invalid.',"red"))
icounter +=1
with open('invalid.txt','a') as handle:
handle.write(token + '\n')
except Exception:
print("Yeah we can't contact discordapp.com")
print ("---------------------------------------")
print (colored("Number of valid tokens: " + str(vcounter),"green"))
print (colored("Number of invalid tokens: " + str(icounter),"red"))
print ("---------------------------------------")
input()