mirror of
https://git.kiwifarms.net/mint/fedi-block-api.git
synced 2024-10-23 01:29:05 +00:00
can now get misskey type
This commit is contained in:
parent
e077b77a74
commit
267f873fb3
1 changed files with 2 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue