mirror of
https://git.kiwifarms.net/mint/fedi-block-api.git
synced 2024-10-23 03:19:06 +00:00
Troonkoma compatibility
This commit is contained in:
parent
1b41db8078
commit
6b2638665d
1 changed files with 4 additions and 1 deletions
|
@ -69,6 +69,9 @@ def get_type(domain: str) -> str:
|
||||||
if res.ok and "text/html" in res.headers["content-type"]:
|
if res.ok and "text/html" in res.headers["content-type"]:
|
||||||
res = get(f"https://{domain}/nodeinfo/2.1", headers=headers, timeout=5)
|
res = get(f"https://{domain}/nodeinfo/2.1", headers=headers, timeout=5)
|
||||||
if res.ok:
|
if res.ok:
|
||||||
|
if res.json()["software"]["name"] == "akkoma"
|
||||||
|
return "pleroma"
|
||||||
|
else
|
||||||
return res.json()["software"]["name"]
|
return res.json()["software"]["name"]
|
||||||
elif res.status_code == 404:
|
elif res.status_code == 404:
|
||||||
res = get(f"https://{domain}/api/v1/instance", headers=headers, timeout=5)
|
res = get(f"https://{domain}/api/v1/instance", headers=headers, timeout=5)
|
||||||
|
|
Loading…
Reference in a new issue