From: Mint <> Date: Tue, 23 Aug 2022 19:56:09 +0000 (+0300) Subject: Add aonther nodeinfo endpoint used by Friendica X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1b75c3b4bcc839efb5314080073fcc0b2f599d31;p=fba.git Add aonther nodeinfo endpoint used by Friendica --- diff --git a/fetch_blocks.py b/fetch_blocks.py index 94e272a..b12a5e3 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -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"]: diff --git a/fetch_instances.py b/fetch_instances.py index db90170..d3434c7 100644 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -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"]: