# Invoke other function, avoid trailing ?
# DEBUG: print(f"DEBUG: components[{type(components)}]={components}")
if components.query != "":
- response = network.fetch_response(components.hostname, f"{components.path}?{components.query}", headers, timeout)
+ response = network.fetch_response(components.netloc, f"{components.path}?{components.query}", headers, timeout)
else:
- response = network.fetch_response(components.hostname, f"{components.path}", headers, timeout)
+ response = network.fetch_response(components.netloc, f"{components.path}", headers, timeout)
# DEBUG: print(f"DEBUG: response[]='{type(response)}' - EXXIT!")
return response
try:
software = determine_software(domain, path)
except network.exceptions as exception:
- print(f"DEBUG: Exception '{type(exception)}' during determining software type")
+ # DEBUG: print(f"DEBUG: Exception '{type(exception)}' during determining software type")
+ pass
# DEBUG: print(f"DEBUG: Determined software='{software}' for domain='{domain}'")
elif not isinstance(software, str):
raise ValueError(f"domain='{domain}' is not a valid domain")
if not instances.is_registered(domain.split("/")[0]):
- # DEBUG: print("DEBUG: Adding new domain:", domain, origin)
- instances.add(domain, origin, command, path)
+ # DEBUG: print(f"DEBUG: Adding new domain='{domain}',origin='{origin}',command='{command}',path='{path}',software='{software}'")
+ instances.add(domain, origin, command, path, software)
# DEBUG: print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...")
instances.set_last_instance_fetch(domain)
print(f"WARNING: instance='{instance}' is a reversed .arpa domain and should not be used generally.")
continue
elif instance.find("/profile/") > 0 or instance.find("/users/") > 0:
- print(f"DEBUG: instance='{instance}' is a link to a single user profile - SKIPPED!")
+ # DEBUG: print(f"DEBUG: instance='{instance}' is a link to a single user profile - SKIPPED!")
continue
elif not instances.is_registered(instance):
# DEBUG: print("DEBUG: Adding new instance:", instance, domain)
print(f"WARNING: domain='{domain}' is not a valid domain - SKIPPED!")
continue
- # DEBUG: print(f"DEBUG: Adding domain='{domain}' ...")
+ # DEBUG: print(f"DEBUG: Adding domain='{domain}',reason='{reason}' ...")
domains.append({
"domain": domain,
"reason": reason,
elif domain.find("/profile/") > 0 or domain.find("/users/") > 0 or (software == "lemmy" and domain.find("/c/") > 0):
raise Exception(f"domain='{domain}' is a single user")
- if isinstance(software, str):
+ if software is None:
try:
# DEBUG: print("DEBUG: domain,origin,command,path:", domain, origin, command, path)
software = federation.determine_software(domain, path)