chevron_left chevron_right
Login Register invert_colors photo_library
Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Simple Proxy Checker filter_list
Author
Message
Simple Proxy Checker #1
Hey there, I made a simple proxy checker in Python.
Save the proxies like that in the proxylist.txt:
Code:
IP:PORT

Spoiler:
Code:
import socket
import os.path
class ProxyChecker():

    def __init__(self):
        print("Starting the checker...")


    def CheckProxy(self):
        try:
            with open('proxylist.txt', 'r+') as f:
                for line in f.readlines():
                    ipAddress = str.split(line, ':')[0]
                    port = str.split(line, ':')[1]
                    proxyIP = (ipAddress, int(port))
                    s = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
                    s.settimeout(5)
                    print("[!] - Checking {} ...".format(proxyIP))
                    if s.connect_ex(proxyIP):
                        pass
                    else:
                        self.AddProxy(ipAddress + ":" + str(port))
        except IOError:
            print('proxylist.txt not found')



    def AddProxy(self, proxyAddress):
        with open('positive.txt', 'a') as f:
            #Duplicate Check:
            with open('positive.txt', 'r+') as r:
                if proxyAddress in r.readlines():
                    print("[!] - {} already added!".format(proxyAddress))
                else:
                    print("[+] - {} added!".format(proxyAddress))
                    f.write(proxyAddress)


if __name__ == "__main__":
    ProxyChecker().CheckProxy()
[Image: i446OyG.png]

[+] 1 user Likes Leviathan's post
Reply






Users browsing this thread: 1 Guest(s)