print proxy in loop

This commit is contained in:
Roy Olav Purser 2021-05-13 08:18:31 +02:00
parent d838166419
commit e94f169303
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -188,12 +188,11 @@ class MainHandler(tornado.web.RequestHandler):
current_list = proxy_list.copy()
current = proxy_list.pop()
proxy_list = [current] + proxy_list
print(f'before head request, {src}')
print(current)
try:
resp = requests.head(src, allow_redirects=True, proxies=current.req, timeout=2)
if resp is not None:
src = resp.url
print(f'after head request, {src}')
except Exception as e:
print(e)
else: