From 77d0de7ef0875a71d2485c339721d5ad4f6ecbdf Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Thu, 13 May 2021 08:31:50 +0200 Subject: [PATCH] cast to string in __repr__ --- stream.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stream.py b/stream.py index 8f8d30a..a97a019 100755 --- a/stream.py +++ b/stream.py @@ -27,7 +27,7 @@ class ProxyElem(): self.req["http"] = "socks5://" + proxy self.req["https"] = "socks5://" + proxy def __repr__(self): - return self.proxy + return str(self.proxy) proxies = {} for key in providers: @@ -188,10 +188,11 @@ class MainHandler(tornado.web.RequestHandler): current_list = proxy_list.copy() current = proxy_list.pop() proxy_list = [current] + proxy_list - print(current) + print(proxy_list) try: resp = requests.head(src, allow_redirects=True, proxies=current.req, timeout=2) if resp is not None: + print(src) src = resp.url except Exception as e: print(e)