Blacklist certain domains (thanks, lamp)

This commit is contained in:
Mint 2022-12-04 17:14:21 +03:00
parent 086300ba81
commit e6492a9246

View 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(