return recently
def deobscure(char: str, domain: str, blocked_hash: str = None) -> tuple:
- #print(f"DEBUG: char='{char}',domain='{domain}',blocked_hash='{blocked_hash}' - CALLED!")
+ # DEBUG: print(f"DEBUG: char='{char}',domain='{domain}',blocked_hash='{blocked_hash}' - CALLED!")
if not isinstance(char, str):
raise ValueError(f"Parameter char[]='{type(char)}' is not 'str'")
elif char == "":
raise ValueError(f"Parameter blocked_hash[]='{type(blocked_hash)}' is not 'str'")
if isinstance(blocked_hash, str):
+ # DEBUG: print(f"DEBUG: Looking up blocked_hash='{blocked_hash}' ...")
fba.cursor.execute(
"SELECT domain, origin, nodeinfo_url FROM instances WHERE hash = ? LIMIT 1", [blocked_hash]
)
- if fba.cursor.fetchone() is None:
- #print(f"DEBUG: blocked_hash='{blocked_hash}' not found, trying domain='{domain}' ...")
+ row = fba.cursor.fetchone()
+ # DEBUG: print(f"DEBUG: row[]='{type(row)}'")
+
+ if row is None:
+ # DEBUG: print(f"DEBUG: blocked_hash='{blocked_hash}' not found, trying domain='{domain}' ...")
return deobscure(char, domain)
else:
+ # DEBUG: print(f"DEBUG: Looking up domain='{domain}' ...")
fba.cursor.execute(
"SELECT domain, origin, nodeinfo_url FROM instances WHERE domain LIKE ? ORDER BY rowid LIMIT 1", [domain.replace(char, "_")]
)
- row = fba.cursor.fetchone()
+ row = fba.cursor.fetchone()
+ # DEBUG: print(f"DEBUG: row[]='{type(row)}'")
- #print(f"DEBUG: row[]='{type(row)}' - EXIT!")
+ # DEBUG: print(f"DEBUG: row[]='{type(row)}' - EXIT!")
return row