add and use combining class

This commit is contained in:
mickael
2019-01-07 23:19:14 +00:00
parent e31ac03f6f
commit 1b3ce72efc
4 changed files with 34 additions and 24 deletions

8
ppf.py
View File

@@ -162,7 +162,7 @@ if __name__ == '__main__':
sqlite.commit()
import_from_file('import.txt', sqlite)
if config.search:
if config._leechd.search:
## load search terms
with open('search_terms.txt', 'r') as f:
search_terms = [ i.strip() for i in f.read().split('\n') if len(i.strip()) ]
@@ -173,7 +173,7 @@ if __name__ == '__main__':
empty = [ urignore.append(i.split('/')[2]) for i in searx_instances ]
# start proxy watcher
if config.watchd_threads > 0:
if config._watchd.threads > 0:
watcherd = proxywatchd.Proxywatchd()
watcherd.start()
else:
@@ -183,11 +183,11 @@ if __name__ == '__main__':
while True:
try:
## any site that needs to be checked ?
rows = [ [i[0],i[1],i[2]] for i in sqlite.execute('SELECT url,hash,error FROM uris WHERE (check_time+?+(error*?) <?) ORDER BY RANDOM() LIMIT 25', (config.url_checktime, config.url_perfail_checktime, time.time())).fetchall() ]
rows = [ [i[0],i[1],i[2]] for i in sqlite.execute('SELECT url,hash,error FROM uris WHERE (check_time+?+(error*?) <?) ORDER BY RANDOM() LIMIT 25', (config._leechd.checktime, config._leechd.perfail_checktime, time.time())).fetchall() ]
if len(rows): proxyleech(sqlite,rows)
## search for new website during free time
elif config.search: proxyfind(sqlite)
elif config._leechd.search: proxyfind(sqlite)
## sleep
else: time.sleep(10)