]> git.mxchange.org Git - fba.git/commitdiff
Blacklist certain domains (thanks, lamp)
authorMint <>
Sun, 4 Dec 2022 14:14:21 +0000 (17:14 +0300)
committerMint <>
Sun, 4 Dec 2022 14:14:21 +0000 (17:14 +0300)
fetch_instances.py

index 30b05a5a2130940a318180a2109c5e92c4564ba3..d20bd317347b41d2d962954f85c3d29ef1760b0d 100644 (file)
@@ -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(