Add aonther nodeinfo endpoint used by Friendica
This commit is contained in:
parent
6e72f19967
commit
1b75c3b4bc
@ -87,6 +87,8 @@ def get_hash(domain: str) -> str:
|
||||
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"]:
|
||||
|
@ -27,6 +27,8 @@ peerlist = get_peers(domain)
|
||||
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"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user