diff --git a/getproxy.py b/getproxy.py index 3165ce3bad..e341459f54 100755 --- a/getproxy.py +++ b/getproxy.py @@ -5,6 +5,7 @@ import time from requests.exceptions import ConnectionError, HTTPError, RequestException + class DownloadProxies: def __init__(self) -> None: self.api = { @@ -51,10 +52,10 @@ def get_special1(self): proxies += proxy[0] + ":" + proxy[1] + "\n" if proxies != '': proxy_list += proxies.split('\n') - except: + except BaseException: pass return proxy_list - except: + except BaseException: return [] def get_special2(self): @@ -66,7 +67,7 @@ def get_special2(self): for p in proxies['data']: protocol = 'http' if p['protocols'][0] == 'https' else p['protocols'][0] self.proxy_dict[protocol].append('{}:{}'.format(p['ip'], p['port'])) - except: + except BaseException: pass def get(self):