Skip to content

🕵️‍♂️ (2-in-1) Email & Username OSINT suite featuring native MCP support for deep data extraction just from a single Email/Username. Analyzes 2720+ actively maintained scan vectors (210+ email / 2510+ username) for security research, investigations, and digital footprinting.

refactor(social/): better error handling to avoid false response

kaifcodec7f378123e5e7
diff --git a/user_scanner/email_scan/social/mastodon.py b/user_scanner/email_scan/social/mastodon.py
index 6084339..4cf586c 100644
--- a/user_scanner/email_scan/social/mastodon.py
+++ b/user_scanner/email_scan/social/mastodon.py
@@ -15,7 +15,7 @@ async def _check(email):
"origin": "https://mastodon.social"
}
- async with httpx.AsyncClient(http2=True, headers=headers, follow_redirects=True) as client:
+ async with httpx.AsyncClient(http2=True, headers=headers, follow_redirects=False) as client:
try:
initial_resp = await client.get(signup_url)
if initial_resp.status_code != 200:
@@ -39,12 +39,16 @@ async def _check(email):
}
response = await client.post(post_url, data=payload)
-
- if "has already been taken" in response.text:
+ res_text = response.text
+ res_status = response.status_code
+ if "has already been taken" in res_text:
return Result.taken()
- else:
+ elif "has already been taken" not in res_text and res_status == 200:
return Result.available()
-
+ elif res_status == 429:
+ return Result.error("Rate limited, use '-d' flag to avoid bot detection")
+ else:
+ return Result.error("Unexpected error, report it via GitHub issues")
except Exception as e:
return Result.error(e)
diff --git a/user_scanner/email_scan/social/x.py b/user_scanner/email_scan/social/x.py
index 8a6dd94..91a7d2a 100644
--- a/user_scanner/email_scan/social/x.py
+++ b/user_scanner/email_scan/social/x.py
@@ -21,15 +21,17 @@ async def _check(email):
response = await client.get(url, params=params, headers=headers)
if response.status_code == 429:
- return Result.error("Rate limited wait for few minutes")
+ return Result.error("Rate limited wait for few minutes or use '-d' flag")
data = response.json()
taken_bool = data.get("taken")
if taken_bool is True:
return Result.taken()
- else:
+ elif taken_bool is False:
return Result.available()
+ else:
+ return Result.error("Unexpected error, report it via GitHub issues")
except Exception as e:
return Result.error(e)