ppf: add optional debug output

This commit is contained in:
rofl0r
2019-01-11 05:03:40 +00:00
parent b6dba08cf0
commit d2cb7441a8
2 changed files with 3 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ class Config(ComboParser):
self.add_item(section, 'database', str, 'websites.sqlite', 'filename of database', True)
section = 'ppf'
self.add_item(section, 'debug', bool, False, 'whether to print additional debug info', False)
self.add_item(section, 'search', bool, True, 'whether to use searx search engine to find new proxy lists', False)
self.add_item(section, 'timeout', float, 15, 'timeout for blocking operations (connect/recv/...) for proxy checks in seconds', False)
self.add_item(section, 'http_retries', int, 1, 'number of retries for http connects', False)

2
ppf.py
View File

@@ -51,6 +51,8 @@ def fetch_contents(url):
'Accept-Language: en-US,en;q=0.8',
'Cache-Control: max-age=0',
]
if config.ppf.debug:
_log("connecting to %s..."%url, "debug")
while True:
proxies = [rocksock.RocksockProxyFromURL('socks4://%s' % random.choice( config.torhosts ))]
http = RsHttp(host,ssl=ssl,port=port, keep_alive=True, timeout=config.ppf.timeout, max_tries=config.ppf.http_retries, 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')