= open("fresh.txt", "r").read() # PROXY SOURCE
for i in proxies.split("\n"):
if i != "":
address, port = i.split(":")
proxy_addresses.append(address)
proxy_ports.append(int(port))
def proxy_check(address, port):
http_proxy = "http://%s:%s" % (address, port)
https_proxy = "https://%s:%s" % (address, port)
ftp_proxy = "ftp://%s:%s" % (address, port)
proxyDict = {
"http": http_proxy,
"https": https_proxy,
"ftp": ftp_proxy
}
try:
result = requests.get("https://wtfismyip.com/text", proxies=proxyDict, timeout=2)
if result.text[:-1] != "MY_IP_ADDRESS":
print(result.text[:-1] + ":%s" % proxy_ports[i])
except:
return
for i in range(0, len(proxy_addresses)):
address = proxy_addresses[i]
port = proxy_ports[i]
if threading.active_count() < 64:
t = threading.Thread(proxy_check(address, port))
t.start()
else:
while not threading.active_count() < 64:
sleep(1)
I am trying to build proxy_checker for my personal use. I am trying to do it with threads. But it is not working much as I expected. Can you tell me where is the problem?
It looks like you posted long piece of code, consider editing it out and putting it on hastebin.com and pasting link to it instead. Alternatively, send your code in a file.
Обсуждают сегодня