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.

fix: false positive and reddit validation logic to use json api

kaifcodece3f6c14af6c5
diff --git a/user_scanner/user_scan/social/reddit.py b/user_scanner/user_scan/social/reddit.py
index c802761..f07a62e 100644
--- a/user_scanner/user_scan/social/reddit.py
+++ b/user_scanner/user_scan/social/reddit.py
@@ -1,18 +1,31 @@
+import json
from user_scanner.core.orchestrator import generic_validate
from user_scanner.core.result import Result
-
def validate_reddit(user):
- url = f"https://www.reddit.com/user/{user}/"
+ url = f"https://www.reddit.com/user/{user}/about.json"
show_url = f"https://www.reddit.com/user/{user}/"
def process(response):
+ if response.status_code == 404:
+ return Result.available()
+
+ if response.status_code == 429:
+ return Result.error("Rate limit exceeded")
+
if response.status_code == 200:
- if "Sorry, nobody on Reddit goes by that name." in response.text:
- return Result.available()
- else:
- return Result.taken()
- else:
- return Result.error()
-
- return generic_validate(url, process, show_url=show_url, follow_redirects=True)
+ try:
+ data = response.json()
+
+ if data.get("error") == 404 or data.get("message") == "Not Found":
+ return Result.available()
+
+ if data.get("kind") == "t2" or "data" in data:
+ return Result.taken()
+
+ except (json.JSONDecodeError, KeyError):
+ return Result.error("Malformed JSON response, report it on Github")
+
+ return Result.error(f"HTTP {response.status_code}")
+
+ return generic_validate(url, process, show_url=show_url)