pretty basic but it does have 3 special features, duplicate prevention, redirect check, and timeout of 8 seconds
Code
#!/usr/bin/python
import urllib2, threading
plist = "./proxies.txt"
proxies = open(plist, "r").readlines()
for ip in proxies:
ip = ip.replace('\n', '').replace(' ', '').replace('\t', '')
print 'Trying %s ...' % ip
try:
proxy_handler = urllib2.ProxyHandler({'http': ip})
opener = urllib2.build_opener(proxy_handler)
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib2.install_opener(opener)
req = urllib2.urlopen('http://www.google.com', timeout=8)
if "google" in req.geturl():
qwerty = open('./working-proxies.txt').read()
if (ip not in qwerty):
print '%s is OK, saved' % ip
f = open("./working-proxies.txt", "a")
f.write(ip + "\n")
f.close()
else:
print 'duplicate prevented'
else:
print 'some kind of bullshit redirect'
except urllib2.HTTPError:
print 'http error'
except Exception:
print 'unknown error'

![[Image: FtwuQgr.gif]](https://i.imgur.com/FtwuQgr.gif)