From 267f873fb3050a0d24dcad9eeb5d53ec2d82328a Mon Sep 17 00:00:00 2001 From: Enju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com> Date: Wed, 13 Apr 2022 23:18:56 +0200 Subject: [PATCH] can now get misskey type --- fetch_blocks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fetch_blocks.py b/fetch_blocks.py index 2d2aab6..352c8ed 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -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: