continue
elif blocked.count("*") > 0:
# Some friendica servers also obscure domains without hash
- row = instances.deobsure("*", blocked)
+ row = instances.deobscure("*", blocked)
# DEBUG: print(f"DEBUG: row[]='{type(row)}'")
if row is None:
nodeinfo_url = row[2]
elif blocked.count("?") > 0:
# Some obscure them with question marks, not sure if that's dependent on version or not
- row = instances.deobsure("?", blocked)
+ row = instances.deobscure("?", blocked)
# DEBUG: print(f"DEBUG: row[]='{type(row)}'")
if row is None:
continue
if domain.find("*") > 0:
- # Try to de-obsure it
- row = instances.deobsure("*", domain)
+ # Try to de-obscure it
+ row = instances.deobscure("*", domain)
# DEBUG: print(f"DEBUG: row[{type(row)}]='{row}'")
if row is None:
elif software in ["calckey", "groundpolis", "foundkey", "cherrypick", "meisskey"]:
# DEBUG: print("DEBUG: Setting misskey:", domain, software)
software = "misskey"
+ elif software == "runtube.re":
+ # DEBUG: print("DEBUG: Setting peertube:", domain, software)
+ software = "peertube"
elif software.find("/") > 0:
print("WARNING: Spliting of slash:", software)
software = tidyup.domain(software.split("/")[-1])
# DEBUG: print(f"DEBUG: recently='{recently}' - EXIT!")
return recently
-def deobsure(char: str, domain: str, blocked_hash: str = None) -> tuple:
+def deobscure(char: str, domain: str, blocked_hash: str = None) -> tuple:
#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'")
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}' ...")
+ return deobscure(char, domain)
else:
fba.cursor.execute(
"SELECT domain, origin, nodeinfo_url FROM instances WHERE domain LIKE ? ORDER BY rowid LIMIT 1", [domain.replace(char, "_")]
continue
elif blocked.count("*") > 0:
# Doing the hash search for instance names as well to tidy up DB
- row = instances.deobsure("*", blocked, blocked_hash)
+ row = instances.deobscure("*", blocked, blocked_hash)
# DEBUG: print(f"DEBUG: row[]='{type(row)}'")
if row is None:
# DEBUG: print(f"DEBUG: blocked='{blocked}' is blacklisted - skipping!")
continue
elif blocked.count("*") > 0:
- # Obsured domain name with no hash
- row = instances.deobsure("*", blocked)
+ # Obscured domain name with no hash
+ row = instances.deobscure("*", blocked)
# DEBUG: print(f"DEBUG: row[]='{type(row)}'")
if row is None:
# DEBUG: print(f"DEBUG: blocked='{blocked}' is blacklisted - skipping!")
continue
elif blocked.count("*") > 0:
- # Obsured domain name with no hash
- row = instances.deobsure("*", blocked)
+ # Obscured domain name with no hash
+ row = instances.deobscure("*", blocked)
# DEBUG: print(f"DEBUG: row[]='{type(row)}'")
if row is None: