From e6492a924658a97002b1646301a83d496c218761 Mon Sep 17 00:00:00 2001 From: Mint <> Date: Sun, 4 Dec 2022 17:14:21 +0300 Subject: [PATCH] Blacklist certain domains (thanks, lamp) --- fetch_instances.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fetch_instances.py b/fetch_instances.py index 30b05a5..d20bd31 100644 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -6,6 +6,12 @@ import json domain = sys.argv[1] +blacklist = [ + "activitypub-troll.cf", + "gab.best", + "4chan.icu" +] + headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0" } @@ -59,6 +65,15 @@ c.execute( for instance in peerlist: instance = instance.lower() + + blacklisted = False + for domain in blacklist: + if domain in instance: + blacklisted = True + + if blacklisted: + continue + print(instance) try: c.execute( -- 2.39.2