Skip to content

Commit

Permalink
fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
FosterG4 authored and iw4p committed Apr 25, 2024
1 parent 3e7880e commit 44df425
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions proxyChecker.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import argparse
import random
import re
import socket
import threading
import urllib.request
import socks
import socket
from time import time

import socks

user_agents = []
with open("user_agents.txt", "r") as f:
for line in f:
Expand All @@ -25,7 +26,8 @@ def is_valid(self):

def check(self, site, timeout, user_agent, verbose):
if self.method in ["socks4", "socks5"]:
socks.set_default_proxy(socks.SOCKS4 if self.method == "socks4" else socks.SOCKS5, self.proxy.split(':')[0], int(self.proxy.split(':')[1]))
socks.set_default_proxy(socks.SOCKS4 if self.method == "socks4" else socks.SOCKS5,
self.proxy.split(':')[0], int(self.proxy.split(':')[1]))
socket.socket = socks.socksocket
try:
start_time = time()
Expand Down Expand Up @@ -131,4 +133,4 @@ def check_proxy(proxy, user_agent):
)
args = parser.parse_args()
check(file=args.list, timeout=args.timeout, method=args.proxy, site=args.site, verbose=args.verbose,
random_user_agent=args.random_agent)
random_user_agent=args.random_agent)

0 comments on commit 44df425

Please sign in to comment.