ppf: print url if fetching failed

This commit is contained in:
rofl0r
2019-01-08 00:46:41 +00:00
parent 20bc8be2fa
commit e7b8d526c0

4
ppf.py
View File

@@ -43,7 +43,9 @@ def fetch_contents(url):
]
proxies = [rocksock.RocksockProxyFromURL('socks4://%s' % random.choice( config.torhosts ))]
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 ''
if not http.connect():
_log("failed to connect to %s"%url, "ppf")
return ''
hdr, res = http.get(uri, headers)
res = res.encode('utf-8') if isinstance(res, unicode) else res
for retry_message in retry_messages: