]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 1 Jun 2025 04:54:59 +0000 (06:54 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 1 Jun 2025 04:54:59 +0000 (06:54 +0200)
- skip empty 'host' rows, might happen with misskey or peertube
- added 'cafkoma' as pleroma alias

fba/commands.py
fba/helpers/software.py
fba/networks/misskey.py
fba/networks/peertube.py

index ae29f0cc1d6f44ecb13d751ab18302e59d1a2837..9dc0d2c1ba76fc45133e85168ed7bbc2c8e37f6d 100644 (file)
@@ -1272,6 +1272,9 @@ def fetch_joinmobilizon(args: argparse.Namespace) -> int:
         if "host" not in row:
             logger.warning("row='%s' does not contain key 'host' - SKIPPED!", row)
             continue
+        elif row["host"] in [None, ""]:
+            logger.warning("row[host]='%s' is empty,source_domain='%s' - SKIPPED!", row["host"], source_domain)
+            continue
         elif not domain_helper.is_wanted(row["host"]):
             logger.debug("row[host]='%s' is not wanted - SKIPPED!", row["host"])
             continue
index 2aadba9e3ad8162c44d7780e00ab86ab26888714..a2ad615666ea9a73e44f6ff1e2110ed5156d70a1 100644 (file)
@@ -99,6 +99,7 @@ _pleroma_aliases = [
     "menzoberranzan",
     "moon-eyed",
     "puppyoma",
+    "cafkoma",
 ]
 
 logging.basicConfig(level=logging.INFO)
index 33563c05851274b22c7576cbebae0ad465eabfd4..4ba88fd21a191f4878915c5492b5301a490847ee 100644 (file)
@@ -110,16 +110,19 @@ def fetch_peers(domain: str) -> list:
                 logger.warning("row()=%d does not contain key 'host': row='%s',domain='%s' - SKIPPED!", len(row), row, domain)
                 continue
             elif not isinstance(row["host"], str):
-                logger.warning("row[host][]='%s' has not expected type 'str' - SKIPPED!", type(row['host']))
+                logger.warning("row[host][]='%s' has not expected type 'str' - SKIPPED!", type(row["host"]))
+                continue
+            elif row["host"] in [None, ""]:
+                logger.warning("row[host]='%s' is empty,domain='%s' - SKIPPED!", row["host"], domain)
                 continue
             elif row["host"] in peers:
-                logger.debug("Not adding row[host]='%s', already found - SKIPPED!", row['host'])
+                logger.debug("Not adding row[host]='%s', already found - SKIPPED!", row["host"])
                 continue
             elif not domain_helper.is_wanted(row["host"]):
                 logger.debug("row[host]='%s' is not wanted - SKIPPED!", row["host"])
                 continue
 
-            logger.debug("Adding peer: row[host]='%s'", row['host'])
+            logger.debug("Adding peer: row[host]='%s'", row["host"])
             added = added + 1
             peers.append(row["host"])
 
index 33f0730802643436ed69ceab6caec2557fc3f3bc..06dafbd546b02827c4f362ec1b9854dccd1c0f9c 100644 (file)
@@ -71,10 +71,13 @@ def fetch_peers(domain: str) -> list:
                 for mode2 in ["follower", "following"]:
                     logger.debug("mode=%s,mode2='%s'", mode, mode2)
                     if mode2 not in record:
-                        logger.debug("Array record does not contain element mode2='%s' - SKIPPED!", mode2)
+                        logger.warning("Array record does not contain element mode2='%s' - SKIPPED!", mode2)
                         continue
                     elif "host" not in record[mode2]:
-                        logger.debug("record[%s] does not contain element 'host' - SKIPPED!", mode2)
+                        logger.warning("record[%s] does not contain element 'host' - SKIPPED!", mode2)
+                        continue
+                    elif record[mode2]["host"] in [None, ""]:
+                        logger.warning("record[%s][host]='%s' is empty - SKIPPED!", mode2, record[mode2]["host"])
                         continue
                     elif record[mode2]["host"] == domain:
                         logger.debug("record[%s]='%s' matches domain='%s' - SKIPPED!", mode2, record[mode2]["host"], domain)