add head timeout
This commit is contained in:
		@@ -178,7 +178,7 @@ class MainHandler(tornado.web.RequestHandler):
 | 
				
			|||||||
                rand.shuffle(proxy_list)
 | 
					                rand.shuffle(proxy_list)
 | 
				
			||||||
                for proxy_temp in proxy_list:
 | 
					                for proxy_temp in proxy_list:
 | 
				
			||||||
                    try:
 | 
					                    try:
 | 
				
			||||||
                        resp = requests.head(src, allow_redirects=True, proxies=proxy_temp.req)
 | 
					                        resp = requests.head(src, allow_redirects=True, proxies=proxy_temp.req, timeout=1)
 | 
				
			||||||
                        if resp is not None:
 | 
					                        if resp is not None:
 | 
				
			||||||
                            src = resp.url
 | 
					                            src = resp.url
 | 
				
			||||||
                    except Exception as e:
 | 
					                    except Exception as e:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user