def get_type(domain: str) -> str:
try:
res = get(f"https://{domain}/nodeinfo/2.1.json", headers=headers, timeout=5)
+ if res.status_code == 404:
+ res = get(f"https://{domain}/nodeinfo/2.0", headers=headers, timeout=5)
if res.status_code == 404:
res = get(f"https://{domain}/nodeinfo/2.0.json", headers=headers, timeout=5)
if res.ok and "text/html" in res.headers["content-type"]:
def get_type(instdomain: str) -> str:
try:
res = get(f"https://{instdomain}/nodeinfo/2.1.json", headers=headers, timeout=5)
+ if res.status_code == 404:
+ res = get(f"https://{instdomain}/nodeinfo/2.0", headers=headers, timeout=5)
if res.status_code == 404:
res = get(f"https://{instdomain}/nodeinfo/2.0.json", headers=headers, timeout=5)
if res.ok and "text/html" in res.headers["content-type"]: