#!/usr/bin/env python
# CleanSocks - Developed by acidvegas in Python (https://git.acid.vegas/proxytools)
'''
This script will clean a list of proxies by removing duplicates, checking for valid formats (IP:PORT), & testing if the proxies are working
'''
import argparse
import concurrent.futures
import os
import re
# Globals
good = list()
print_bad = True
def check(proxy):
ip, port = proxy.split(':')
try:
sock = socks.socksocket()
sock.set_proxy(socks.SOCKS5, ip, int(port))
sock.settimeout(args.timeout)
sock.connect('www.google.com', 80)) # NOTE: use your own host instead in-case connections are blocked
except:
if print_bad:
print('\033[1;31mBAD\033[0m \033[30m|\033[0m ' + proxy)
else:
print('\033[1;32mGOOD\033[0m \033[30m|\033[0m ' + proxy)
good.append(proxy)
# Main
print('#'*56)
print('#{0}#'.format(''.center(54)))
print('#{0}#'.format('CleanSOCKS Proxy Cleaner'.center(54)))
print('#{0}#'.format('Developed by acidvegas in Python'.center(54)))
print('#{0}#'.format('https://git.acid.vegas/proxytools'.center(54)))
print('#{0}#'.format(''.center(54)))
print('#'*56)
parser = argparse.ArgumentParser(usage='%(prog)s