]> git.mxchange.org Git - fba.git/commitdiff
Normalize case
authorMint <>
Sat, 6 Aug 2022 15:31:31 +0000 (18:31 +0300)
committerMint <>
Sat, 6 Aug 2022 15:31:31 +0000 (18:31 +0300)
fetch_blocks.py
fetch_instances.py

index c84ec57c39ecf35d3d0d5ffc6c5593a8eebfb940..104a79e0e83bfb49513e7120a6b3439e18ddd902 100644 (file)
@@ -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,)
                         )
index e1ab48ab9bc14ce2f8205f15441a21b005e7aa7d..c59d7fa33927a887bcf928aadabb561410901bf5 100644 (file)
@@ -52,6 +52,7 @@ c.execute(
 )
 
 for instance in peerlist:
+    instance = instance.lower()
     print(instance)
     try:
         if c.fetchone() == None: