From: Roland Häder Date: Sat, 3 Jun 2023 07:02:04 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c08d5750da708043fc6ee4051425d860adb1e0ae;p=fba.git Continued: - 3rd parameter is not 'origin', it is 'script' --- diff --git a/fetch_blocks.py b/fetch_blocks.py index 154bd97..bfc2838 100755 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -123,7 +123,7 @@ for blocker, software, origin, nodeinfo_url in rows: continue elif not fba.is_instance_registered(blocked): # DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'") - fba.add_instance(blocked, blocker, origin, nodeinfo_url) + fba.add_instance(blocked, blocker, sys.argv[0], nodeinfo_url) fba.cursor.execute( "SELECT * FROM blocks WHERE blocker = ? AND blocked = ? AND block_level = ? LIMIT 1", @@ -204,7 +204,7 @@ for blocker, software, origin, nodeinfo_url in rows: continue elif not fba.is_instance_registered(blocked): # DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'") - fba.add_instance(blocked, blocker, origin, nodeinfo_url) + fba.add_instance(blocked, blocker, sys.argv[0], nodeinfo_url) # DEBUG: print("DEBUG: Updating block reason:", blocker, blocked, reason["reason"]) fba.update_block_reason(reason["reason"], blocker, blocked, block_level) @@ -317,7 +317,7 @@ for blocker, software, origin, nodeinfo_url in rows: continue elif not fba.is_instance_registered(blocked): # DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'") - fba.add_instance(blocked, blocker, origin, nodeinfo_url) + fba.add_instance(blocked, blocker, sys.argv[0], nodeinfo_url) elif not validators.domain(blocked): print(f"WARNING: blocked='{blocked}',software='{software}' is not a valid domai name - skipped!") continue @@ -328,7 +328,7 @@ for blocker, software, origin, nodeinfo_url in rows: continue elif not fba.is_instance_registered(blocked): # DEBUG: print("DEBUG: Hash wasn't found, adding:", blocked, blocker) - fba.add_instance(blocked, blocker, origin, nodeinfo_url) + fba.add_instance(blocked, blocker, sys.argv[0], nodeinfo_url) blocking = blocked if blocked.count("*") <= 1 else blocked_hash # DEBUG: print(f"DEBUG: blocking='{blocking}',blocked='{blocked}',blocked_hash='{blocked_hash}'") @@ -438,7 +438,7 @@ for blocker, software, origin, nodeinfo_url in rows: continue elif not fba.is_instance_registered(blocked): # DEBUG: print("DEBUG: Hash wasn't found, adding:", blocked, blocker) - fba.add_instance(blocked, blocker, origin, nodeinfo_url) + fba.add_instance(blocked, blocker, sys.argv[0], nodeinfo_url) fba.cursor.execute( "SELECT * FROM blocks WHERE blocker = ? AND blocked = ? AND block_level = ? LIMIT 1", @@ -510,7 +510,7 @@ for blocker, software, origin, nodeinfo_url in rows: continue elif not fba.is_instance_registered(blocked): # DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'") - fba.add_instance(blocked, blocker, origin, nodeinfo_url) + fba.add_instance(blocked, blocker, sys.argv[0], nodeinfo_url) fba.cursor.execute( "SELECT * FROM blocks WHERE blocker = ? AND blocked = ? AND block_level = ? LIMIT 1",