-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxycheck.py
More file actions
executable file
·35 lines (31 loc) · 956 Bytes
/
proxycheck.py
File metadata and controls
executable file
·35 lines (31 loc) · 956 Bytes
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
import proxyhandler
import products
from multiprocessing import Process
import time
file = './proxies_check.txt'
proxies = proxyhandler.read_proxies(file)
sites = products.generate_sitelist()
site = sites[0]
def main(proxy):
proxy_formatted = proxyhandler.proxy_parse(proxy)
try:
start = time.time()
products.List(site, proxy_formatted)
end = time.time()
time_elapsed = end - start
time_elapsed = time_elapsed * 1000
if time_elapsed < 5000:
with open('proxies_good_mar7.txt', 'a') as f:
f.write(f'{proxy}\n')
print(proxy, ' - GOOD PROXY')
else:
print(proxy, ' - SLOW PROXY - ', time_elapsed)
except:
print(proxy, ' - BAD PROXY')
if __name__ == '__main__':
for proxy in proxies:
p = Process(target=main, args=(proxy,))
p.start() # starting workers
p.join()
time.sleep(3)
print(f'ALL PROXIES CHECKED')