mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-02-08 22:13:49 +01:00
29 lines
595 B
Python
29 lines
595 B
Python
#
|
|
#
|
|
#
|
|
|
|
import netdb
|
|
|
|
|
|
from argparse import ArgumentParser as AP
|
|
|
|
from . import settings
|
|
from . import filter
|
|
from . import processor
|
|
|
|
def main():
|
|
ap = AP()
|
|
ap.add_argument("--settings", default="baddies.ini")
|
|
|
|
args = ap.parse_args()
|
|
s = settings.load(args.settings)
|
|
fmax = s.get("thresholds", "max_floodfills_per_ip", fallback=5)
|
|
f = filter.FloodfillFilter(fmax)
|
|
p = processor.BaddieProcessor([f])
|
|
netdb.inspect(p.hook)
|
|
with open(s.get("output", "file", fallback="baddies.txt"), 'w') as f:
|
|
p.write_blocklist(f)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|