]> git.mxchange.org Git - fba.git/commitdiff
can now get misskey type
authorEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Wed, 13 Apr 2022 21:18:56 +0000 (23:18 +0200)
committerEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Wed, 13 Apr 2022 21:18:56 +0000 (23:18 +0200)
fetch_blocks.py

index 2d2aab69da779272e0707e0ab7ce355d6725205e..352c8ed1825a4b3f216d5184f105254959b38a5d 100644 (file)
@@ -51,6 +51,8 @@ def get_type(domain: str) -> str:
         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.json", headers=headers, timeout=5)
+        if res.ok and "text/html" in res.headers["content-type"]:
+            res = get(f"https://{domain}/nodeinfo/2.1", headers=headers, timeout=5)
         if res.ok:
             return res.json()["software"]["name"]
         elif res.status_code == 404: