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.

feat(user_scan): add new username scan modules and reorganize categories (#581)

Kaifdc2c01a3ebf5
diff --git a/user_scanner/user_scan/community/d3_ru.py b/user_scanner/user_scan/community/d3_ru.py
new file mode 100644
index 0000000..8ad8ede
--- /dev/null
+++ b/user_scanner/user_scan/community/d3_ru.py
@@ -0,0 +1,67 @@
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_d3_ru(user: str) -> Result:
+ """Validate a username on D3.ru (d3.ru)."""
+ url = f"https://d3.ru/user/{user}/"
+ show_url = f"https://d3.ru/user/{user}/"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or explicit Russian not-found marker)
+ if (
+ response.status_code == 404
+ or "ничего не найдено" in response_text_lower
+ or "d3.ru — ничего не найдено" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + deep data extraction
+ if response.status_code == 200 and "d3.ru" in response_text_lower:
+ title_match = re.search(r"<title>d3\.ru — (.*?)</title>", response.text, re.IGNORECASE)
+ if title_match:
+ title_name = title_match.group(1).strip()
+ if title_name and "ничего не найдено" not in title_name.lower():
+ extra = {}
+
+ # Extract Full Name if available and distinct
+ fullname_match = re.search(r'<h3 class="b-user_full_name">([^<]+)</h3>', response.text)
+ if fullname_match:
+ fullname = fullname_match.group(1).strip()
+ if fullname and fullname.lower() != title_name.lower():
+ extra["fullname"] = fullname
+ extra["name"] = title_name
+
+ # Extract Karma / Score
+ karma_match = re.search(r'class="b-karma_value">([^<]+)</span>', response.text)
+ if karma_match:
+ extra["karma"] = karma_match.group(1).strip()
+
+ # Extract Residence / Location
+ residence_match = re.search(r'<div class="b-user_residence">([^<]+)</div>', response.text)
+ if residence_match:
+ residence = residence_match.group(1).strip()
+ if residence:
+ extra["location"] = residence
+
+ # Extract Subscribers / Followers
+ subs_match = re.search(r'class="b-user_subscription_text">([^<]+)</div>', response.text)
+ if subs_match:
+ subs = subs_match.group(1).strip()
+ if subs:
+ extra["followers"] = subs
+
+ return Result.taken(extra=extra, url=show_url)
+
+ return Result.error("Could not verify profile details on D3.ru", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/community/fandom.py b/user_scanner/user_scan/community/fandom.py
new file mode 100644
index 0000000..9f2b584
--- /dev/null
+++ b/user_scanner/user_scan/community/fandom.py
@@ -0,0 +1,60 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_fandom(user: str) -> Result:
+ """Validate a username on Fandom (fandom.com)."""
+ url = (
+ f"https://community.fandom.com/api.php"
+ f"?action=query&list=users&ususers={user}&usprop=registration|gender|editcount|groups&format=json"
+ )
+ show_url = f"https://community.fandom.com/wiki/User:{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json, text/plain, */*",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + Fandom API response
+ if response.status_code == 200 and "users" in response.text:
+ try:
+ data = json.loads(response.text)
+ users = data.get("query", {}).get("users", [])
+
+ if not users:
+ return Result.available(url=show_url)
+
+ user_data = users[0]
+
+ # Explicit check for Fandom MediaWiki "missing" flag
+ if "missing" in user_data:
+ return Result.available(url=show_url)
+
+ if "userid" in user_data:
+ extra = {}
+ if name := user_data.get("name"):
+ extra["name"] = str(name).strip()
+ if user_id := user_data.get("userid"):
+ extra["user_id"] = str(user_id)
+ if edit_count := user_data.get("editcount"):
+ extra["edit_count"] = str(edit_count)
+ if reg := user_data.get("registration"):
+ extra["registered"] = str(reg).strip()
+ if groups := user_data.get("groups"):
+ filtered_groups = [g for g in groups if g != "*"]
+ if filtered_groups:
+ extra["groups"] = ", ".join(filtered_groups)
+
+ return Result.taken(extra=extra, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse Fandom API response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/social/35photo.py b/user_scanner/user_scan/creative/35photo.py
similarity index 100%
rename from user_scanner/user_scan/social/35photo.py
rename to user_scanner/user_scan/creative/35photo.py
diff --git a/user_scanner/user_scan/creator/behance.py b/user_scanner/user_scan/creative/behance.py
similarity index 100%
rename from user_scanner/user_scan/creator/behance.py
rename to user_scanner/user_scan/creative/behance.py
diff --git a/user_scanner/user_scan/creative/civitai.py b/user_scanner/user_scan/creative/civitai.py
new file mode 100644
index 0000000..d7a58b8
--- /dev/null
+++ b/user_scanner/user_scan/creative/civitai.py
@@ -0,0 +1,61 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_civitai(user: str) -> Result:
+ """Validate a creator on Civitai (civitai.com)."""
+ url = f"https://civitai.com/api/v1/creators?query={user}"
+ show_url = f"https://civitai.com/user/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + Civitai creators JSON response
+ if response.status_code == 200 and "items" in response.text:
+ try:
+ data = json.loads(response.text)
+ items = data.get("items", [])
+
+ if not items or len(items) == 0:
+ return Result.available(url=show_url)
+
+ matched_creator = None
+ for item in items:
+ if (item.get("username") or "").lower() == user.lower():
+ matched_creator = item
+ break
+
+ if not matched_creator and items:
+ matched_creator = items[0]
+
+ if matched_creator:
+ extra = {}
+ media = {}
+
+ if creator_name := matched_creator.get("username"):
+ extra["username"] = str(creator_name).strip()
+ if model_count := matched_creator.get("modelCount"):
+ extra["models_count"] = str(model_count)
+ if creator_link := matched_creator.get("link"):
+ extra["models_api"] = str(creator_link).strip()
+
+ if avatar := matched_creator.get("image"):
+ media["avatar"] = str(avatar).strip()
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ return Result.available(url=show_url)
+ except Exception:
+ return Result.error("Failed to parse Civitai JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/social/deviantart.py b/user_scanner/user_scan/creative/deviantart.py
similarity index 100%
rename from user_scanner/user_scan/social/deviantart.py
rename to user_scanner/user_scan/creative/deviantart.py
diff --git a/user_scanner/user_scan/creator/dribbble.py b/user_scanner/user_scan/creative/dribbble.py
similarity index 100%
rename from user_scanner/user_scan/creator/dribbble.py
rename to user_scanner/user_scan/creative/dribbble.py
diff --git a/user_scanner/user_scan/dev/figma.py b/user_scanner/user_scan/creative/figma.py
similarity index 100%
rename from user_scanner/user_scan/dev/figma.py
rename to user_scanner/user_scan/creative/figma.py
diff --git a/user_scanner/user_scan/social/flickr.py b/user_scanner/user_scan/creative/flickr.py
similarity index 100%
rename from user_scanner/user_scan/social/flickr.py
rename to user_scanner/user_scan/creative/flickr.py
diff --git a/user_scanner/user_scan/creator/magnific.py b/user_scanner/user_scan/creative/magnific.py
similarity index 100%
rename from user_scanner/user_scan/creator/magnific.py
rename to user_scanner/user_scan/creative/magnific.py
diff --git a/user_scanner/user_scan/social/picsart.py b/user_scanner/user_scan/creative/picsart.py
similarity index 100%
rename from user_scanner/user_scan/social/picsart.py
rename to user_scanner/user_scan/creative/picsart.py
diff --git a/user_scanner/user_scan/social/px500.py b/user_scanner/user_scan/creative/px500.py
similarity index 100%
rename from user_scanner/user_scan/social/px500.py
rename to user_scanner/user_scan/creative/px500.py
diff --git a/user_scanner/user_scan/creator/unsplash.py b/user_scanner/user_scan/creative/unsplash.py
similarity index 100%
rename from user_scanner/user_scan/creator/unsplash.py
rename to user_scanner/user_scan/creative/unsplash.py
diff --git a/user_scanner/user_scan/creator/bio_link.py b/user_scanner/user_scan/creator/bio_link.py
new file mode 100644
index 0000000..a46d5d6
--- /dev/null
+++ b/user_scanner/user_scan/creator/bio_link.py
@@ -0,0 +1,56 @@
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_bio_link(user: str) -> Result:
+ """Validate a creator profile on Bio.link (bio.link)."""
+ url = f"https://bio.link/{user}"
+ show_url = f"https://bio.link/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or 404 page title)
+ title_match = re.search(r"<title>(.*?)</title>", response.text, re.IGNORECASE)
+ page_title = title_match.group(1).strip() if title_match else ""
+
+ if (
+ response.status_code == 404
+ or "page not found" in page_title.lower()
+ or "page not found" in response_text_lower
+ or "404" in page_title
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200:
+ extra = {"username": user}
+ media = {}
+
+ if page_title and "page not found" not in page_title.lower():
+ display_name = page_title.replace(" - Bio.link", "").replace(" | Bio.link", "").strip()
+ if display_name and display_name.lower() != "bio.link":
+ extra["name"] = display_name
+
+ og_title_match = re.search(r'<meta property="og:title" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_title_match and "name" not in extra:
+ og_name = og_title_match.group(1).strip()
+ if og_name and og_name.lower() != "bio.link":
+ extra["name"] = og_name
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "bio-link-logo" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/other/paragraph.py b/user_scanner/user_scan/creator/paragraph.py
similarity index 100%
rename from user_scanner/user_scan/other/paragraph.py
rename to user_scanner/user_scan/creator/paragraph.py
diff --git a/user_scanner/user_scan/creator/rumble.py b/user_scanner/user_scan/creator/rumble.py
new file mode 100644
index 0000000..bdcd173
--- /dev/null
+++ b/user_scanner/user_scan/creator/rumble.py
@@ -0,0 +1,51 @@
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_rumble(user: str) -> Result:
+ """Validate a channel/creator on Rumble (rumble.com)."""
+ url = f"https://rumble.com/c/{user}"
+ show_url = f"https://rumble.com/c/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or 404 title)
+ title_match = re.search(r"<title>(.*?)</title>", response.text, re.IGNORECASE)
+ page_title = title_match.group(1).strip() if title_match else ""
+
+ if (
+ response.status_code == 404
+ or "404 not found" in page_title.lower()
+ or "page not found" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and "rumble" in response_text_lower:
+ if page_title and "404" not in page_title:
+ extra = {"channel": user}
+ media = {}
+
+ channel_name = page_title.replace(" - Rumble", "").replace(" on Rumble", "").strip()
+ if channel_name and channel_name.lower() != "rumble":
+ extra["name"] = channel_name
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "rumble-logo" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ return Result.error("Could not verify channel details on Rumble", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/creator/solo_to.py b/user_scanner/user_scan/creator/solo_to.py
new file mode 100644
index 0000000..31a4d3b
--- /dev/null
+++ b/user_scanner/user_scan/creator/solo_to.py
@@ -0,0 +1,51 @@
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_solo_to(user: str) -> Result:
+ """Validate a creator profile on Solo.to (solo.to)."""
+ url = f"https://solo.to/{user}"
+ show_url = f"https://solo.to/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or Not Found title)
+ title_match = re.search(r"<title>(.*?)</title>", response.text, re.IGNORECASE)
+ page_title = title_match.group(1).strip() if title_match else ""
+
+ if (
+ response.status_code == 404
+ or "not found · solo.to" in page_title.lower()
+ or "page not found" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and "solo.to" in response_text_lower:
+ if "· solo.to" in page_title:
+ extra = {"username": user}
+ media = {}
+
+ display_name = page_title.replace(" · solo.to", "").replace(" | solo.to", "").strip()
+ if display_name and display_name.lower() != "not found":
+ extra["name"] = display_name
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "solo-logo" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ return Result.error("Could not verify profile details on Solo.to", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/creator/taplink.py b/user_scanner/user_scan/creator/taplink.py
new file mode 100644
index 0000000..5a338cb
--- /dev/null
+++ b/user_scanner/user_scan/creator/taplink.py
@@ -0,0 +1,72 @@
+import json
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_taplink(user: str) -> Result:
+ """Validate a username on Taplink (taplink.cc)."""
+ url = f"https://taplink.cc/{user}"
+ show_url = f"https://taplink.cc/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or generic fallback markers)
+ if (
+ response.status_code == 404
+ or "landing page that drives your sales on instagram" in response_text_lower
+ or "link in bio tool for instagram and tiktok - taplink" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + deep data extraction
+ if response.status_code == 200 and "taplink" in response_text_lower:
+ og_title_match = re.search(r'<meta property="og:title" content="(.*?)"', response.text)
+ account_match = re.search(r"window\.account\s*=\s*({.*?});", response.text)
+
+ if og_title_match or account_match:
+ extra = {}
+ media = {}
+
+ if og_title_match:
+ og_title = og_title_match.group(1).strip()
+ if og_title.endswith(" at Taplink") or " at Taplink" in og_title:
+ name = og_title.replace(" at Taplink", "").strip()
+ if name:
+ extra["name"] = name
+
+ if account_match:
+ try:
+ account_data = json.loads(account_match.group(1))
+ if account_id := account_data.get("account_id"):
+ extra["account_id"] = str(account_id)
+ if profile_id := account_data.get("profile_id"):
+ extra["profile_id"] = str(profile_id)
+ if lang := account_data.get("language_code"):
+ extra["language"] = str(lang)
+ if tariff := account_data.get("tariff_current"):
+ extra["plan"] = str(tariff)
+ except Exception:
+ pass
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and not img_url.endswith("taplink-opengraph.jpg"):
+ if img_url.startswith("//"):
+ img_url = f"https:{img_url}"
+ media["avatar"] = img_url
+
+ if extra or media:
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ return Result.error("Could not verify profile details on Taplink", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/dev/devpost.py b/user_scanner/user_scan/dev/devpost.py
new file mode 100644
index 0000000..48ed1a6
--- /dev/null
+++ b/user_scanner/user_scan/dev/devpost.py
@@ -0,0 +1,54 @@
+import html
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_devpost(user: str) -> Result:
+ """Validate a developer portfolio on Devpost (devpost.com)."""
+ url = f"https://devpost.com/{user}"
+ show_url = f"https://devpost.com/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or missing portfolio marker)
+ title_match = re.search(r"<title>(.*?)</title>", response.text, re.IGNORECASE)
+ raw_title = title_match.group(1).strip() if title_match else ""
+ page_title = html.unescape(raw_title)
+
+ if (
+ response.status_code == 404
+ or (response.status_code == 200 and page_title.lower() == "devpost" and "portfolio" not in response_text_lower)
+ or "page not found" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and "devpost" in response_text_lower:
+ if "software portfolio" in page_title.lower() or f"/{user.lower()}" in response_text_lower:
+ extra = {"username": user}
+ media = {}
+
+ if "'s (" in page_title or "’s (" in page_title:
+ name_part = re.split(r"['’]s\s*\(", page_title)[0].strip()
+ if name_part:
+ extra["name"] = name_part
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "default-avatar" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ return Result.error("Could not verify portfolio details on Devpost", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/dev/xakep.py b/user_scanner/user_scan/dev/xakep.py
new file mode 100644
index 0000000..ce5c571
--- /dev/null
+++ b/user_scanner/user_scan/dev/xakep.py
@@ -0,0 +1,48 @@
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_xakep(user: str) -> Result:
+ """Validate a username on Xakep.ru (xakep.ru)."""
+ url = f"https://xakep.ru/author/{user}/"
+ show_url = f"https://xakep.ru/author/{user}/"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or explicit Russian 404 marker)
+ if (
+ response.status_code == 404
+ or "страница не найдена" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + deep data extraction
+ if response.status_code == 200 and "xakep" in response_text_lower:
+ title_match = re.search(
+ r"<title>(.*?)(?:&#8212;|&mdash;|—|-)\s*Хакер</title>",
+ response.text,
+ re.IGNORECASE,
+ )
+ if title_match:
+ author_name = title_match.group(1).strip()
+ if author_name and "страница не найдена" not in author_name.lower():
+ extra = {"name": author_name}
+
+ # Extract Author ID from body class
+ author_id_match = re.search(r'author-(\d+)', response.text)
+ if author_id_match:
+ extra["author_id"] = author_id_match.group(1)
+
+ return Result.taken(extra=extra, url=show_url)
+
+ return Result.error("Could not verify author details on Xakep.ru", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/finance/fragment.py b/user_scanner/user_scan/finance/fragment.py
new file mode 100644
index 0000000..5acb81f
--- /dev/null
+++ b/user_scanner/user_scan/finance/fragment.py
@@ -0,0 +1,48 @@
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_fragment(user: str) -> Result:
+ """Validate a username on Fragment (fragment.com)."""
+ url = f"https://fragment.com/username/{user}"
+ show_url = f"https://fragment.com/username/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or generic fallback title)
+ title_match = re.search(r"<title>(.*?)</title>", response.text, re.IGNORECASE)
+ page_title = title_match.group(1).strip() if title_match else ""
+
+ if response.status_code == 404 or (
+ response.status_code == 200 and page_title.lower() == "fragment" and "tm-section-header-status" not in response.text
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and "fragment" in response_text_lower:
+ if user.lower() in page_title.lower() or "tm-section-header-status" in response.text or "tm-value" in response.text:
+ extra = {"username": user}
+
+ status_match = re.search(r'<div class="tm-section-header-status[^"]*">([^<]+)</div>', response.text)
+ if status_match:
+ extra["status"] = status_match.group(1).strip()
+
+ price_match = re.search(r'<div class="table-cell-value tm-value[^>]*>([^<]+)</div>', response.text)
+ if price_match:
+ price_val = price_match.group(1).strip()
+ if price_val and not price_val.startswith("@"):
+ extra["price_ton"] = price_val
+
+ return Result.taken(extra=extra, url=show_url)
+
+ return Result.error("Could not verify username details on Fragment", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/finance/paypal.py b/user_scanner/user_scan/finance/paypal.py
new file mode 100644
index 0000000..9c9d930
--- /dev/null
+++ b/user_scanner/user_scan/finance/paypal.py
@@ -0,0 +1,65 @@
+import html
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_paypal(user: str) -> Result:
+ """Validate a PayPal.Me username on PayPal (paypal.com)."""
+ url = f"https://www.paypal.com/paypalme/{user}"
+ show_url = f"https://www.paypal.com/paypalme/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept-Language": "en-US,en;q=0.9",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # Extract OpenGraph title and description
+ og_title_match = re.search(r'<meta property="og:title" content="(.*?)"', response.text, re.IGNORECASE)
+ raw_og_title = og_title_match.group(1).strip() if og_title_match else ""
+ og_title = html.unescape(raw_og_title)
+
+ og_desc_match = re.search(r'<meta property="og:description" content="(.*?)"', response.text, re.IGNORECASE)
+ raw_og_desc = og_desc_match.group(1).strip() if og_desc_match else ""
+ og_desc = html.unescape(raw_og_desc)
+
+ has_user_in_desc = f"paypal.me/{user.lower()}" in og_desc.lower()
+
+ # 1. Explicit verification of available / not-found state
+ # PayPal returns 404 OR 200 with generic "Get your very own PayPal.Me link" landing page
+ if (
+ response.status_code == 404
+ or "we couldn't find this page" in response_text_lower
+ or "we can't seem to find the page" in response_text_lower
+ or "isn't active" in response_text_lower
+ or og_title.lower() in ["get your very own paypal.me link", "paypal.me", "paypal", ""]
+ or not has_user_in_desc
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and has_user_in_desc:
+ extra = {"handle": user}
+ media = {}
+
+ # Extract user's display name from "Pay <Name> using PayPal.Me"
+ name_match = re.search(r"Pay\s+(.*?)\s+using\s+PayPal\.Me", og_title, re.IGNORECASE)
+ if name_match:
+ extra["name"] = name_match.group(1).strip()
+ elif og_title and "paypal" not in og_title.lower():
+ extra["name"] = og_title
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "pplogo" not in img_url.lower() and "paypal-logo" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/gaming/modrinth.py b/user_scanner/user_scan/gaming/modrinth.py
new file mode 100644
index 0000000..1012db3
--- /dev/null
+++ b/user_scanner/user_scan/gaming/modrinth.py
@@ -0,0 +1,51 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_modrinth(user: str) -> Result:
+ """Validate a username on Modrinth (modrinth.com)."""
+ url = f"https://api.modrinth.com/v2/user/{user}"
+ show_url = f"https://modrinth.com/user/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + Modrinth user JSON response
+ if response.status_code == 200 and "username" in response.text:
+ try:
+ data = json.loads(response.text)
+ if (data.get("username") or "").lower() == user.lower() or data.get("id"):
+ extra = {}
+ media = {}
+
+ if username := data.get("username"):
+ extra["username"] = str(username).strip()
+ if name := data.get("name"):
+ extra["name"] = str(name).strip()
+ if user_id := data.get("id"):
+ extra["user_id"] = str(user_id).strip()
+ if role := data.get("role"):
+ extra["role"] = str(role).strip()
+ if bio := data.get("bio"):
+ extra["bio"] = str(bio).strip()
+ if created := data.get("created"):
+ extra["created"] = str(created).strip()
+
+ if avatar := data.get("avatar_url"):
+ media["avatar"] = str(avatar).strip()
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse Modrinth JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/learning/dblp.py b/user_scanner/user_scan/learning/dblp.py
new file mode 100644
index 0000000..9d5432e
--- /dev/null
+++ b/user_scanner/user_scan/learning/dblp.py
@@ -0,0 +1,52 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_dblp(user: str) -> Result:
+ """Validate an author/researcher username on DBLP (dblp.org)."""
+ url = f"https://dblp.org/search/author/api?q={user}&format=json"
+ show_url = f"https://dblp.org/search/author?q={user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json, text/plain, */*",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + DBLP JSON response
+ if response.status_code == 200 and "result" in response.text:
+ try:
+ data = json.loads(response.text)
+ hits_data = data.get("result", {}).get("hits", {})
+ total_hits = int(hits_data.get("@total", 0))
+
+ if total_hits == 0:
+ return Result.available(url=show_url)
+
+ hit_items = hits_data.get("hit", [])
+ if isinstance(hit_items, dict):
+ hit_items = [hit_items]
+
+ if hit_items and isinstance(hit_items, list):
+ first_hit = hit_items[0].get("info", {})
+ extra = {}
+
+ if author_name := first_hit.get("author"):
+ extra["author"] = str(author_name).strip()
+ if author_url := first_hit.get("url"):
+ extra["dblp_url"] = str(author_url).strip()
+ if total_hits > 1:
+ extra["total_matches"] = str(total_hits)
+
+ return Result.taken(extra=extra, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse DBLP JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/learning/openalex.py b/user_scanner/user_scan/learning/openalex.py
new file mode 100644
index 0000000..c59df0b
--- /dev/null
+++ b/user_scanner/user_scan/learning/openalex.py
@@ -0,0 +1,56 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_openalex(user: str) -> Result:
+ """Validate a researcher/author on OpenAlex (openalex.org)."""
+ url = f"https://api.openalex.org/authors?filter=display_name.search:{user}"
+ show_url = f"https://openalex.org/authors?search={user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json, text/plain, */*",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + OpenAlex JSON response
+ if response.status_code == 200 and "meta" in response.text:
+ try:
+ data = json.loads(response.text)
+ count = data.get("meta", {}).get("count", 0)
+
+ if count == 0:
+ return Result.available(url=show_url)
+
+ results = data.get("results", [])
+ if results and isinstance(results, list):
+ top_author = results[0]
+ extra = {}
+
+ if display_name := top_author.get("display_name"):
+ extra["name"] = str(display_name).strip()
+ if orcid := top_author.get("orcid"):
+ extra["orcid"] = str(orcid).strip()
+ if works_cnt := top_author.get("works_count"):
+ extra["works_count"] = str(works_cnt)
+ if cited_cnt := top_author.get("cited_by_count"):
+ extra["citations"] = str(cited_cnt)
+
+ institutions = top_author.get("last_known_institutions") or top_author.get("affiliations")
+ if institutions and isinstance(institutions, list):
+ inst_name = institutions[0].get("display_name") or institutions[0].get("institution", {}).get("display_name")
+ if inst_name:
+ extra["institution"] = str(inst_name).strip()
+
+ return Result.taken(extra=extra, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse OpenAlex JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/learning/orcid.py b/user_scanner/user_scan/learning/orcid.py
new file mode 100644
index 0000000..37e2862
--- /dev/null
+++ b/user_scanner/user_scan/learning/orcid.py
@@ -0,0 +1,61 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_orcid(user: str) -> Result:
+ """Validate a researcher on ORCID (orcid.org)."""
+ url = f"https://pub.orcid.org/v3.0/expanded-search/?q={user}&start=0&rows=5"
+ show_url = f"https://orcid.org/orcid-search/search?searchQuery={user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json, text/plain, */*",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + ORCID JSON response
+ if response.status_code == 200 and "num-found" in response.text:
+ try:
+ data = json.loads(response.text)
+ num_found = data.get("num-found", 0)
+
+ if num_found == 0:
+ return Result.available(url=show_url)
+
+ results = data.get("expanded-result", [])
+ if results and isinstance(results, list):
+ first_record = results[0]
+ extra = {}
+
+ given = first_record.get("given-names") or ""
+ family = first_record.get("family-names") or ""
+ credit = first_record.get("credit-name") or ""
+ full_name = f"{given} {family}".strip() or credit
+ if full_name:
+ extra["name"] = full_name
+
+ if orcid_id := first_record.get("orcid-id"):
+ extra["orcid_id"] = str(orcid_id).strip()
+
+ institutions = first_record.get("institution-name", [])
+ if institutions and isinstance(institutions, list):
+ unique_inst = list(dict.fromkeys(institutions))[:3]
+ if unique_inst:
+ extra["institution"] = ", ".join(str(i) for i in unique_inst)
+
+ emails = first_record.get("email", [])
+ if emails and isinstance(emails, list):
+ extra["public_emails"] = ", ".join(str(e) for e in emails)
+
+ return Result.taken(extra=extra, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse ORCID JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/music/audiomack.py b/user_scanner/user_scan/music/audiomack.py
new file mode 100644
index 0000000..098fe1c
--- /dev/null
+++ b/user_scanner/user_scan/music/audiomack.py
@@ -0,0 +1,58 @@
+import html
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_audiomack(user: str) -> Result:
+ """Validate an artist/user on Audiomack (audiomack.com)."""
+ url = f"https://audiomack.com/{user}"
+ show_url = f"https://audiomack.com/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or generic platform fallback title / og:type website)
+ title_match = re.search(r"<title>(.*?)</title>", response.text, re.IGNORECASE)
+ raw_title = title_match.group(1).strip() if title_match else ""
+ page_title = html.unescape(raw_title)
+
+ type_match = re.search(r'<meta property="og:type" content="(.*?)"', response.text, re.IGNORECASE)
+ og_type = type_match.group(1).strip().lower() if type_match else ""
+
+ if response.status_code == 404 or (
+ response.status_code == 200
+ and og_type == "website"
+ and "music platform empowering" in page_title.lower()
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and "audiomack" in response_text_lower:
+ if og_type == "profile" or "listen free on audiomack" in page_title.lower():
+ extra = {"username": user}
+ media = {}
+
+ name_match = re.search(r'<meta property="profile:first_name" content="(.*?)"', response.text, re.IGNORECASE)
+ if name_match:
+ extra["name"] = name_match.group(1).strip()
+ elif " - listen free on audiomack" in page_title.lower():
+ extra["name"] = re.sub(r" - listen free on audiomack.*", "", page_title, flags=re.IGNORECASE).strip()
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "audiomack-logo" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ return Result.available(url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/other/statsfm.py b/user_scanner/user_scan/music/statsfm.py
similarity index 100%
rename from user_scanner/user_scan/other/statsfm.py
rename to user_scanner/user_scan/music/statsfm.py
diff --git a/user_scanner/user_scan/social/aparat.py b/user_scanner/user_scan/social/aparat.py
new file mode 100644
index 0000000..805ba88
--- /dev/null
+++ b/user_scanner/user_scan/social/aparat.py
@@ -0,0 +1,57 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_aparat(user: str) -> Result:
+ """Validate a username on Aparat (aparat.com)."""
+ url = f"https://www.aparat.com/api/fa/v1/user/user/information/username/{user}"
+ show_url = f"https://www.aparat.com/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json, text/plain, */*",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found state (HTTP 404 or explicit error detail)
+ if response.status_code == 404 or "page not found" in response.text.lower():
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + deep data extraction
+ if response.status_code == 200 and "attributes" in response.text:
+ try:
+ data = json.loads(response.text)
+ attrs = data.get("data", {}).get("attributes", {})
+ username = attrs.get("username")
+
+ if username and str(username).lower() == user.lower():
+ extra = {}
+ media = {}
+
+ if name := attrs.get("name"):
+ extra["name"] = str(name).strip()
+ if descr := attrs.get("descr"):
+ if str(descr).strip():
+ extra["bio"] = str(descr).strip()
+ if followers := (attrs.get("follower_cnt_num") or attrs.get("follower_cnt")):
+ extra["followers"] = str(followers)
+ if following := attrs.get("follow_cnt"):
+ extra["following"] = str(following)
+ if video_cnt := attrs.get("video_cnt"):
+ extra["videos"] = str(video_cnt)
+ if website := attrs.get("url"):
+ if str(website).strip() and str(website).strip() != "http://www.aparat.com":
+ extra["website"] = str(website).strip()
+
+ avatar = attrs.get("pic_b") or attrs.get("pic_m") or attrs.get("pic_s")
+ if avatar and str(avatar).strip():
+ media["avatar"] = str(avatar).strip()
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse Aparat JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/social/ifunny.py b/user_scanner/user_scan/social/ifunny.py
new file mode 100644
index 0000000..04cb3c7
--- /dev/null
+++ b/user_scanner/user_scan/social/ifunny.py
@@ -0,0 +1,62 @@
+import json
+import re
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_ifunny(user: str) -> Result:
+ """Validate a username on iFunny (ifunny.co)."""
+ url = f"https://ifunny.co/user/{user}"
+ show_url = f"https://ifunny.co/user/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ }
+
+ def process(response):
+ response_text_lower = response.text.lower()
+
+ # 1. Explicit verification of available / not-found state (HTTP 404 or explicit 404 title)
+ if (
+ response.status_code == 404
+ or "404 - page not found" in response_text_lower
+ or "user not found" in response_text_lower
+ ):
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of taken state + data extraction
+ if response.status_code == 200 and "ifunny" in response_text_lower:
+ extra = {"username": user}
+ media = {}
+
+ state_match = re.search(r"window\.__INITIAL_STATE__\s*=\s*({.*?});", response.text)
+ if state_match:
+ try:
+ state_data = json.loads(state_match.group(1))
+ user_data = state_data.get("user", {}) or state_data.get("profile", {})
+ if nick := user_data.get("nick"):
+ extra["name"] = str(nick).strip()
+ if subscribers := (user_data.get("subscribers_count") or user_data.get("num_subscribers")):
+ extra["subscribers"] = str(subscribers)
+ if avatar := (user_data.get("photo_url") or user_data.get("avatar_url")):
+ media["avatar"] = str(avatar).strip()
+ except Exception:
+ pass
+
+ og_title_match = re.search(r'<meta property="og:title" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_title_match and "name" not in extra:
+ og_name = og_title_match.group(1).replace(" on iFunny", "").replace(" | iFunny", "").strip()
+ if og_name and og_name.lower() != "ifunny":
+ extra["name"] = og_name
+
+ og_img_match = re.search(r'<meta property="og:image" content="(.*?)"', response.text, re.IGNORECASE)
+ if og_img_match and "avatar" not in media:
+ img_url = og_img_match.group(1).strip()
+ if img_url and "ifunny_logo" not in img_url.lower():
+ media["avatar"] = img_url
+
+ return Result.taken(extra=extra, media=media, url=show_url)
+
+ # 3. Graceful error for unexpected status codes (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)
diff --git a/user_scanner/user_scan/social/memory_lol.py b/user_scanner/user_scan/social/memory_lol.py
new file mode 100644
index 0000000..a7efcc1
--- /dev/null
+++ b/user_scanner/user_scan/social/memory_lol.py
@@ -0,0 +1,50 @@
+import json
+from user_scanner.core.orchestrator import generic_validate
+from user_scanner.core.result import Result
+
+
+def validate_memory_lol(user: str) -> Result:
+ """Validate historical Twitter/X handle presence on Memory.lol (memory.lol)."""
+ url = f"https://api.memory.lol/v1/tw/{user}"
+ show_url = f"https://memory.lol/tw/{user}"
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "Accept": "application/json, text/plain, */*",
+ }
+
+ def process(response):
+ # 1. Explicit check for not-found HTTP status
+ if response.status_code == 404:
+ return Result.available(url=show_url)
+
+ # 2. Explicit verification of 200 OK + Memory.lol JSON response
+ if response.status_code == 200 and "accounts" in response.text:
+ try:
+ data = json.loads(response.text)
+ accounts = data.get("accounts", [])
+
+ if not accounts or len(accounts) == 0:
+ return Result.available(url=show_url)
+
+ account = accounts[0]
+ extra = {}
+
+ if account_id := (account.get("id_str") or account.get("id")):
+ extra["twitter_id"] = str(account_id)
+
+ screen_names_map = account.get("screen_names", {})
+ for handle_key, dates in screen_names_map.items():
+ if isinstance(dates, list) and dates:
+ extra["first_seen"] = str(dates[0])
+ if len(dates) > 1:
+ extra["last_seen"] = str(dates[-1])
+ break
+
+ return Result.taken(extra=extra, url=show_url)
+ except Exception:
+ return Result.error("Failed to parse Memory.lol JSON response", url=show_url)
+
+ # 3. Graceful error for unexpected status codes or unhandled responses (No bare else!)
+ return Result.error(f"Unexpected response status: {response.status_code}", url=show_url)
+
+ return generic_validate(url, process, headers=headers, show_url=show_url, follow_redirects=True)