From ad7c7fce670f24e8a15d1b7186a56c4101638d24 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Mon, 7 Jan 2019 05:37:44 +0000 Subject: [PATCH] ppf: use timeout and only 1 try for http --- ppf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppf.py b/ppf.py index 9760f5a..e33c56d 100755 --- a/ppf.py +++ b/ppf.py @@ -42,7 +42,7 @@ def fetch_contents(url): 'Cache-Control: max-age=0', ] proxies = [rocksock.RocksockProxyFromURL('socks4://%s' % random.choice( config.torhosts ))] - http = RsHttp(host,ssl=ssl,port=port, keep_alive=True, follow_redirects=True, auto_set_cookies=True, proxies=proxies, user_agent='Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0') + http = RsHttp(host,ssl=ssl,port=port, keep_alive=True, timeout=15, max_tries=1, follow_redirects=True, auto_set_cookies=True, proxies=proxies, user_agent='Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0') if not http.connect(): return '' hdr, res = http.get(uri, headers) res = res.encode('utf-8') if isinstance(res, unicode) else res