split to ip/port, "cleanse" ips and ports, bugfixes

This commit is contained in:
Your Name
2021-08-22 20:39:50 +02:00
parent c3bb49d229
commit d7db366857
3 changed files with 36 additions and 17 deletions

8
dbs.py
View File

@@ -13,6 +13,9 @@ def create_table_if_not_exists(sqlite, dbname):
proto TEXT,
mitm INT,
success_count INT,
ip TEXT,
port INT,
consecutive_success INT,
total_duration INT)""")
elif dbname == 'uris':
@@ -34,9 +37,10 @@ def insert_proxies(proxydb, proxies, url):
new = []
for p in proxies:
new.append((timestamp,p,3,0,0,0,0,0))
ip, port = p.split(':')
new.append((timestamp,p,ip,port,3,0,0,0,0,0))
proxydb.executemany('INSERT OR IGNORE INTO proxylist (added,proxy,failed,tested,success_count,total_duration,mitm,consecutive_success) VALUES (?,?,?,?,?,?,?,?)', new)
proxydb.executemany('INSERT OR IGNORE INTO proxylist (added,proxy,ip,port,failed,tested,success_count,total_duration,mitm,consecutive_success) VALUES (?,?,?,?,?,?,?,?,?,?)', new)
proxydb.commit()
_log('+%d proxy/ies from %s' % (len(proxies), url), 'added')