From 62c0f62aa0cad9a8a7c92c34cc6473a82dc43793 Mon Sep 17 00:00:00 2001 From: db0 Date: Sat, 23 Sep 2023 23:16:03 +0200 Subject: [PATCH] fix: check email last --- fediseer/fediverse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fediseer/fediverse.py b/fediseer/fediverse.py index 34e2fe8..7ab3c59 100644 --- a/fediseer/fediverse.py +++ b/fediseer/fediverse.py @@ -101,16 +101,16 @@ def discover_admins(domain,software): try: site = requests.get(f"https://{domain}/api/v1/instance") site_json = site.json() - # Pleroma/Akkoma style - if "email" in site_json: - admin_username = site_json["email"].split('@',1)[0] - return [admin_username] # Misskey/Firefish style if "contact_account" in site_json: return [site_json["contact_account"]["username"]] # Mastodon style if "contact" in site_json: return [site_json["contact"]["account"]["username"]] + # Pleroma/Akkoma style + if "email" in site_json: + admin_username = site_json["email"].split('@',1)[0] + return [admin_username] raise Exception(f"Site software '{software} does not match any of the known APIs") except Exception as err: logger.error(f"Error retrieving {software} site info for {domain}: {err}")