From b28e523b68273676905aca7eee730563463cc064 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 11 Jul 2023 00:53:18 +0200 Subject: [PATCH] Continued: - okay, then don't check if they are punycode and then raise an exception ... --- fba/commands.py | 6 ------ fba/helpers/domain.py | 2 -- fba/utils.py | 2 -- 3 files changed, 10 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index bd3d393..6c06579 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -363,8 +363,6 @@ def fetch_blocks(args: argparse.Namespace) -> int: elif block["blocked"].endswith(".tld"): logger.debug("blocked='%s' is a fake domain - SKIPPED", block["blocked"]) continue - elif "xn--" in block["blocked"]: - raise ValueError(f"blocked='{block['blocked']}' is a punycode domain, please don't crawl them!") elif block["blocked"].find("*") >= 0: logger.debug("blocker='%s' uses obfuscated domains", blocker) @@ -1075,8 +1073,6 @@ def fetch_oliphant(args: argparse.Namespace) -> int: elif domain.endswith(".tld"): logger.debug("domain='%s' is a fake domain - SKIPPED", domain) continue - elif "xn--" in domain: - raise ValueError(f"domain='{domain}' is a punycode domain, please translate them back!") elif domain.find("*") >= 0 or domain.find("?") >= 0: logger.debug("domain='%s' is obfuscated - Invoking utils.deobfuscate(%s, %s) ...", domain, domain, block["blocker"]) domain = utils.deobfuscate(domain, block["blocker"]) @@ -1467,8 +1463,6 @@ def recheck_obfuscation(args: argparse.Namespace) -> int: elif block["blocked"].endswith(".tld"): logger.debug("blocked='%s' is a fake domain name - SKIPPED!", block["blocked"]) continue - elif "xn--" in block["blocked"]: - raise ValueError(f"blocked='{block['blocked']}' is a punycode domain, please translate them back!") elif block["blocked"].endswith(".onion"): logger.debug("blocked='%s' is a TOR onion domain name - SKIPPED!", block["blocked"]) continue diff --git a/fba/helpers/domain.py b/fba/helpers/domain.py index 75f97a5..5328e3f 100644 --- a/fba/helpers/domain.py +++ b/fba/helpers/domain.py @@ -39,8 +39,6 @@ def raise_on(domain: str): raise ValueError(f"domain='{domain}' is a TOR, please don't crawl them!") elif domain.endswith(".tld"): raise ValueError(f"domain='{domain}' is a fake domain, please don't crawl them!") - elif "xn--" in domain: - raise ValueError(f"domain='{domain}' is a punycode domain, please don't crawl them!") logger.debug("EXIT!") diff --git a/fba/utils.py b/fba/utils.py index 019938c..6007635 100644 --- a/fba/utils.py +++ b/fba/utils.py @@ -174,8 +174,6 @@ def is_domain_wanted(domain: str) -> bool: elif domain.endswith(".tld"): logger.debug("domain='%s' is a fake domain - settings False ...", domain) wanted = False - elif "xn--" in domain: - raise ValueError(f"domain='{domain}' is a punycode domain, please don't crawl them!") elif blacklist.is_blacklisted(domain): logger.debug("domain='%s' is blacklisted - settings False ...", domain) wanted = False -- 2.39.5