]> git.mxchange.org Git - fba.git/commitdiff
Add aonther nodeinfo endpoint used by Friendica
authorMint <>
Tue, 23 Aug 2022 19:56:09 +0000 (22:56 +0300)
committerMint <>
Tue, 23 Aug 2022 19:56:09 +0000 (22:56 +0300)
fetch_blocks.py
fetch_instances.py

index 94e272a790c0a869bc4784a7a9fcedb6a0558ca8..b12a5e3d983c1fba90f9b6e5010d9842fb75ee26 100644 (file)
@@ -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"]:
index db9017007cde6c4d24bdf815b5c511cdbeb8937b..d3434c7c4375b90015043a03403628a4e9cdf1be 100644 (file)
@@ -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"]: