From 76671bae89aa421d9d01e6b028c4726b02b23840 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 6 Feb 2021 21:05:09 +0000 Subject: [PATCH] Filter for obviously hostile domains --- utils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 3e7c8c4ec..f024a2b98 100644 --- a/utils.py +++ b/utils.py @@ -494,10 +494,20 @@ def evilIncarnate() -> []: def isEvil(domain: str) -> bool: + # https://www.youtube.com/watch?v=5qw1hcevmdU if not isinstance(domain, str): print('WARN: Malformed domain ' + str(domain)) return True - # https://www.youtube.com/watch?v=5qw1hcevmdU + # if a domain contains any of these strings then it is + # declaring itself to be hostile + evilEmporium = ( + 'nazi', 'extremis', 'extreemis', 'gendercritic', + 'kiwifarm', 'illegal', 'raplst', 'rapist', + 'antivax', 'plandemic' + ) + for hostileStr in evilEmporium: + if hostileStr in domain: + return True evilDomains = evilIncarnate() for concentratedEvil in evilDomains: if domain.endswith(concentratedEvil):