From d8fc0154b73c75fc57c733cde920a4bcd086640f Mon Sep 17 00:00:00 2001 From: Mint <> Date: Sat, 6 Aug 2022 18:31:31 +0300 Subject: [PATCH] Normalize case --- fetch_blocks.py | 3 ++- fetch_instances.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fetch_blocks.py b/fetch_blocks.py index c84ec57..104a79e 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -44,7 +44,7 @@ def get_mastodon_blocks(domain: str) -> dict: if header_text in blocks: blocks[header_text].append( { - "domain": line.find("span").text, + "domain": line.find("span").text.lower(), "hash": line.find("span")["title"][9:], "reason": line.find_all("td")[1].text.strip(), } @@ -104,6 +104,7 @@ for blocker, software in c.fetchall(): for blocked in blocks: if blocked == "": continue + blocked == blocked.lower() c.execute( "select domain from instances where domain = ?", (blocked,) ) diff --git a/fetch_instances.py b/fetch_instances.py index e1ab48a..c59d7fa 100644 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -52,6 +52,7 @@ c.execute( ) for instance in peerlist: + instance = instance.lower() print(instance) try: if c.fetchone() == None: