forked from rohamasadi/instagramCracker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CheckProxy.py
65 lines (53 loc) · 1.7 KB
/
CheckProxy.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/python3
import os, time, requests, sys, threading
CheckVersion = str(sys.version)
def cls():
linux = 'clear'
windows = 'cls'
os.system([linux,windows][os.name == 'nt'])
cls()
def xx(PROXY, url):
try:
sess = requests.session()
sess.proxies = {'http': PROXY}
sess.headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
' (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'}
aa = sess.get(url, timeout=5, proxies={'http': PROXY})
if aa.status_code == 200:
print (PROXY + ' GooD')
with open('OKproxy.txt', 'a') as xX:
xX.write(PROXY + '\n')
else:
print (PROXY + ' BaD')
except:
print (PROXY + ' BaD')
def main():
try:
if '3.' in CheckVersion:
try:
fileproxy = input(' Proxy.txt --> ')
except:
print(' [-] Error : Enter Your Proxy!')
sys.exit()
elif '2.' in CheckVersion:
try:
fileproxy = raw_input(' Proxy.txt --> ')
except:
print(' [-] Error : Enter Your Proxy!')
sys.exit()
else:
print(' Unknown Python Version!')
except:
pass
sys.exit()
with open(fileproxy, 'r') as x:
prox = x.read().splitlines()
thread = []
for proxy in prox:
t = threading.Thread(target=xx, args=(proxy, 'https://instagram.com'))
t.start()
thread.append(t)
time.sleep(0.1)
for j in thread:
j.join()
main()