From 5a01e3a0e522038671d0a8ad83038f11ac6c99d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 22 Oct 2023 06:28:48 +0200 Subject: [PATCH] Continued: - skip empty domain names before is_wanted() is invocated --- fba/networks/misskey.py | 5 ++++- fba/networks/pleroma.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fba/networks/misskey.py b/fba/networks/misskey.py index b57c252..045b506 100644 --- a/fba/networks/misskey.py +++ b/fba/networks/misskey.py @@ -288,7 +288,10 @@ def fetch_blocks(domain: str) -> list: blocked = tidyup.domain(instance["host"]) logger.debug("blocked='%s'", blocked) - if not domain_helper.is_wanted(blocked): + if blocked is None or blocked == "": + logger.warning("instance[host]='%s' is None or empty after tidyup.domain() - SKIPPED!", instance["host"]) + continue + elif not domain_helper.is_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) continue elif "isBlocked" in instance and instance["isBlocked"] and not dict_helper.has_key(blocklist, "blocked", blocked): diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index b4e98fe..9e4eeb3 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -135,7 +135,10 @@ def fetch_blocks(domain: str) -> list: blocked = utils.deobfuscate(blocked, domain) logger.debug("blocked='%s' - DEOBFUSCATED!", blocked) - if not domain_helper.is_wanted(blocked): + if blocked is None or blocked == "": + logger.warning("instance[host]='%s' is None or empty after tidyup.domain() - SKIPPED!", instance["host"]) + continue + elif not domain_helper.is_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) continue -- 2.39.5