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: enable deep data extraction for 15 new user_scan modules

Kaifadc450536dab
diff --git a/user_scanner/user_scan/creator/ameblo.py b/user_scanner/user_scan/creator/ameblo.py
index 13e2067..cfa220a 100644
--- a/user_scanner/user_scan/creator/ameblo.py
+++ b/user_scanner/user_scan/creator/ameblo.py
@@ -1,8 +1,23 @@
-from user_scanner.core.orchestrator import status_validate
+import re
+from user_scanner.core.orchestrator import Result, make_request
def validate_ameblo(user):
url = f"https://ameblo.jp/{user}"
show_url = f"https://ameblo.jp/{user}"
- return status_validate(url, 404, 200, show_url=show_url, follow_redirects=True)
+ try:
+ response = make_request(url, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ title = re.search(r'<title>([^<]+)</title>', html)
+ if title:
+ extra["name"] = title.group(1).replace("プロフィール", "").strip()
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/devto.py b/user_scanner/user_scan/creator/devto.py
index f5a649e..31036d7 100644
--- a/user_scanner/user_scan/creator/devto.py
+++ b/user_scanner/user_scan/creator/devto.py
@@ -1,8 +1,30 @@
-from user_scanner.core.orchestrator import status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_devto(user):
- url = f"https://dev.to/{user}"
+ url = f"https://dev.to/api/users/by_username?url={user}"
show_url = f"https://dev.to/{user}"
- return status_validate(url, 404, 200, show_url=show_url, follow_redirects=True)
+ try:
+ response = make_request(url, follow_redirects=True)
+ if response.status_code == 200:
+ data = response.json()
+ extra = {}
+ if name := data.get("name"):
+ extra["name"] = name
+ if summary := data.get("summary"):
+ extra["bio"] = summary.strip()
+ if location := data.get("location"):
+ extra["location"] = location
+ if joined_at := data.get("joined_at"):
+ extra["joined_at"] = joined_at
+ if website := data.get("website_url"):
+ extra["website"] = website
+
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/dribbble.py b/user_scanner/user_scan/creator/dribbble.py
index 683a2d7..0d7cc5e 100644
--- a/user_scanner/user_scan/creator/dribbble.py
+++ b/user_scanner/user_scan/creator/dribbble.py
@@ -1,5 +1,6 @@
+import re
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_dribbble(user):
@@ -12,4 +13,27 @@ def validate_dribbble(user):
"Accept-Encoding": "gzip, deflate, br, zstd",
}
- return status_validate(url, 404, 200, show_url=show_url, headers=headers)
+ try:
+ response = make_request(url, headers=headers, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ name_match = re.search(r'<meta name=\"description\" content=\"([^\|]+?)\s*\|', html)
+ if name_match:
+ extra['name'] = name_match.group(1).strip()
+
+ bio_match = re.search(r'<meta name=\"description\" content=\"[^\|]+\|\s*([^\|]+?)\s*\|', html)
+ if bio_match:
+ extra['bio'] = bio_match.group(1).strip()
+
+ loc_match = re.search(r'class=\"location[^\"]*\">([^<]+)</span>', html, re.I)
+ if loc_match:
+ extra['location'] = loc_match.group(1).strip()
+
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status code: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/gumroad.py b/user_scanner/user_scan/creator/gumroad.py
index c21381b..2628a2b 100644
--- a/user_scanner/user_scan/creator/gumroad.py
+++ b/user_scanner/user_scan/creator/gumroad.py
@@ -1,6 +1,5 @@
import re
-
-from user_scanner.core.orchestrator import Result, status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_gumroad(user: str) -> Result:
@@ -11,4 +10,19 @@ def validate_gumroad(user: str) -> Result:
url = f"https://{user}.gumroad.com/"
show_url = f"https://{user}.gumroad.com"
- return status_validate(url, 404, 200, show_url=show_url, follow_redirects=True)
+
+ try:
+ response = make_request(url, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ title = re.search(r'<title>([^\|]+)\|', html)
+ if title:
+ extra["name"] = title.group(1).strip()
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/itch_io.py b/user_scanner/user_scan/creator/itch_io.py
index 337af6f..de0602a 100644
--- a/user_scanner/user_scan/creator/itch_io.py
+++ b/user_scanner/user_scan/creator/itch_io.py
@@ -1,6 +1,5 @@
import re
-
-from user_scanner.core.orchestrator import Result, status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_itch_io(user: str) -> Result:
@@ -10,7 +9,6 @@ def validate_itch_io(user: str) -> Result:
if not re.match(r"^[a-z0-9_-]+$", user):
if re.search(r"[A-Z]", user):
return Result.error("Use lowercase letters only.")
-
return Result.error(
"Only use lowercase letters, numbers, underscores, and hyphens."
)
@@ -18,4 +16,18 @@ def validate_itch_io(user: str) -> Result:
url = f"https://itch.io/profile/{user}"
show_url = f"https://itch.io/profile/{user}"
- return status_validate(url, 404, 200, show_url=show_url, follow_redirects=True)
+ try:
+ response = make_request(url, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ title = re.search(r'<title>([^<]+)- itch.io</title>', html)
+ if title:
+ extra["name"] = title.group(1).strip()
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/kaggle.py b/user_scanner/user_scan/creator/kaggle.py
index 59351eb..f0034f4 100644
--- a/user_scanner/user_scan/creator/kaggle.py
+++ b/user_scanner/user_scan/creator/kaggle.py
@@ -1,8 +1,23 @@
-from user_scanner.core.orchestrator import status_validate
+import re
+from user_scanner.core.orchestrator import Result, make_request
def validate_kaggle(user):
url = f"https://www.kaggle.com/{user}"
show_url = f"https://www.kaggle.com/{user}"
- return status_validate(url, 404, 200, show_url=show_url, follow_redirects=True)
+ try:
+ response = make_request(url, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ title = re.search(r'<title>([^\|]+)\|', html)
+ if title:
+ extra["name"] = title.group(1).strip()
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/linktree.py b/user_scanner/user_scan/creator/linktree.py
index 7d294e9..563374d 100644
--- a/user_scanner/user_scan/creator/linktree.py
+++ b/user_scanner/user_scan/creator/linktree.py
@@ -1,5 +1,6 @@
+import re
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_linktree(user):
@@ -12,6 +13,18 @@ def validate_linktree(user):
"Accept-Encoding": "gzip, deflate, br, zstd",
}
- return status_validate(
- url, 404, 200, show_url=show_url, headers=headers, follow_redirects=True
- )
+ try:
+ response = make_request(url, headers=headers, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ title = re.search(r'<title>([^\|]+)\|', html)
+ if title:
+ extra["name"] = title.group(1).strip()
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/patreon.py b/user_scanner/user_scan/creator/patreon.py
index d8fd454..d255ecf 100644
--- a/user_scanner/user_scan/creator/patreon.py
+++ b/user_scanner/user_scan/creator/patreon.py
@@ -1,10 +1,30 @@
-from user_scanner.core.orchestrator import status_validate
+import re
+import json
+from user_scanner.core.orchestrator import Result, make_request
def validate_patreon(user):
url = f"https://www.patreon.com/{user}"
show_url = f"https://www.patreon.com/{user}"
- return status_validate(
- url, 404, 200, show_url=show_url, timeout=15.0, follow_redirects=True
- )
+ try:
+ response = make_request(url, timeout=15.0, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ ld = re.search(r'<script type=\"application/ld\+json\">(.*?)</script>', html, re.DOTALL)
+ if ld:
+ try:
+ data = json.loads(ld.group(1))
+ if isinstance(data, list): data = data[0]
+ if name := data.get("name"): extra["name"] = name
+ if curl := data.get("url"): extra["url"] = curl
+ except:
+ pass
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/producthunt.py b/user_scanner/user_scan/creator/producthunt.py
index 03e8d06..6584bcc 100644
--- a/user_scanner/user_scan/creator/producthunt.py
+++ b/user_scanner/user_scan/creator/producthunt.py
@@ -1,7 +1,7 @@
import re
-
+import json
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import Result, status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_producthunt(user: str) -> Result:
@@ -16,12 +16,42 @@ def validate_producthunt(user: str) -> Result:
show_url = f"https://www.producthunt.com/@{user}"
headers = {
- "User-Agent": get_random_user_agent(),
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
- "Accept-Encoding": "gzip, deflate, br",
+ "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": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.9",
+ "Cache-Control": "max-age=0",
+ "Upgrade-Insecure-Requests": "1",
}
- return status_validate(
- url, 404, 200, show_url=show_url, headers=headers, follow_redirects=True
- )
+ try:
+ response = make_request(url, headers=headers, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+
+ ld = re.search(r'<script type=\"application/ld\+json\">(.*?)</script>', html, re.DOTALL)
+ if ld:
+ try:
+ data = json.loads(ld.group(1))
+ if isinstance(data, list): data = data[0]
+ if name := data.get("name"): extra["name"] = name
+ if curl := data.get("url"): extra["url"] = curl
+ except:
+ pass
+
+ if "name" not in extra:
+ title_match = re.search(r'<title>([^<]+?)(?:&#x27;s|\'s) profile', html)
+ if title_match:
+ extra["name"] = title_match.group(1).strip()
+ else:
+ meta = re.search(r'See what kind of products\s+([^\(]+)', html)
+ if meta:
+ extra["name"] = meta.group(1).strip()
+
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/creator/substack.py b/user_scanner/user_scan/creator/substack.py
index 02d26cb..9113035 100644
--- a/user_scanner/user_scan/creator/substack.py
+++ b/user_scanner/user_scan/creator/substack.py
@@ -1,7 +1,6 @@
import re
-
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import Result, status_validate
+from user_scanner.core.orchestrator import Result, make_request
def validate_substack(user: str) -> Result:
@@ -24,6 +23,28 @@ def validate_substack(user: str) -> Result:
"priority": "u=0, i",
}
- return status_validate(
- url, 404, 200, show_url=show_url, headers=headers, follow_redirects=True
- )
+ try:
+ response = make_request(url, headers=headers, follow_redirects=True)
+ if response.status_code == 200:
+ html = response.text
+ extra = {}
+ import json
+ ld = re.search(r'<script type=\"application/ld\+json\">(.*?)</script>', html, re.DOTALL)
+ if ld:
+ try:
+ data = json.loads(ld.group(1))
+ if isinstance(data, list): data = data[0]
+ if name := data.get("name"): extra["name"] = name
+ except:
+ pass
+ if "name" not in extra:
+ title = re.search(r'<title>([^<]+)</title>', html)
+ if title and "|" in title.group(1):
+ extra["name"] = title.group(1).split("|")[0].strip()
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/dev/leetcode.py b/user_scanner/user_scan/dev/leetcode.py
index 51b2151..e1dbc72 100644
--- a/user_scanner/user_scan/dev/leetcode.py
+++ b/user_scanner/user_scan/dev/leetcode.py
@@ -1,7 +1,10 @@
import re
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import Result, status_validate
+from user_scanner.core.orchestrator import Result, make_request
+from urllib.parse import quote
+import json
+import re
def validate_leetcode(user: str) -> Result:
@@ -13,18 +16,41 @@ def validate_leetcode(user: str) -> Result:
"Can only use letters, numbers, underscores, periods, or hyphens"
)
- url = f"https://leetcode.com/u/{user}/"
show_url = f"https://leetcode.com/u/{user}/"
+
+ query = '''query userPublicProfile($username: String!) { matchedUser(username: $username) { username profile { realName aboutMe userAvatar countryName company school ranking } } }'''
+ variables = json.dumps({"username": user})
+ url = f"https://leetcode.com/graphql?query={quote(query)}&variables={quote(variables)}"
headers = {
"User-Agent": get_random_user_agent(),
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
- "Accept-Encoding": "identity",
- "upgrade-insecure-requests": "1",
- "accept-language": "en-US,en;q=0.9",
- "priority": "u=0, i",
+ "Accept": "application/json, text/plain, */*",
}
- return status_validate(
- url, 404, 200, show_url=show_url, headers=headers, follow_redirects=True
- )
+ try:
+ response = make_request(url, headers=headers)
+ if response.status_code == 200:
+ data = response.json()
+ if data.get("errors") and "That user does not exist" in str(data.get("errors")):
+ return Result.available(url=show_url)
+
+ matched_user = data.get("data", {}).get("matchedUser")
+ if matched_user:
+ extra = {}
+ profile = matched_user.get("profile", {})
+
+ if profile.get("realName"): extra["fullname"] = profile.get("realName")
+ if profile.get("aboutMe"): extra["bio"] = profile.get("aboutMe")
+ if profile.get("userAvatar"): extra["image"] = profile.get("userAvatar")
+ if profile.get("countryName"): extra["country"] = profile.get("countryName")
+ if profile.get("company"): extra["company"] = profile.get("company")
+ if profile.get("school"): extra["school"] = profile.get("school")
+ if profile.get("ranking"): extra["ranking"] = profile.get("ranking")
+
+ return Result.taken(extra=extra, url=show_url)
+
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/donation/buymeacoffee.py b/user_scanner/user_scan/donation/buymeacoffee.py
index 495c188..02ced70 100644
--- a/user_scanner/user_scan/donation/buymeacoffee.py
+++ b/user_scanner/user_scan/donation/buymeacoffee.py
@@ -1,8 +1,34 @@
-from user_scanner.core.orchestrator import status_validate
+from user_scanner.core.helpers import get_random_user_agent
+from user_scanner.core.orchestrator import Result, make_request
+import re
def validate_buymeacoffee(user):
url = f"https://buymeacoffee.com/{user}"
show_url = f"https://buymeacoffee.com/{user}"
+ headers = {"User-Agent": get_random_user_agent()}
- return status_validate(url, 404, 200, show_url=show_url, follow_redirects=True)
+ try:
+ response = make_request(url, headers=headers, follow_redirects=True)
+ if response.status_code == 200:
+ extra = {}
+
+ # Extract Name (from og:title or title)
+ n = re.search(r'<meta property="og:title" content="([^"]+)"', response.text)
+ if not n: n = re.search(r'<title[^>]*>([^<]+?)(?:\s*-\s*Buymeacoffee)?</title>', response.text, re.IGNORECASE)
+ if n: extra['name'] = n.group(1).strip()
+
+ m = re.search(r'<meta name="description" content="([^"]+)"', response.text)
+ if not m: m = re.search(r'<meta property="og:description" content="([^"]+)"', response.text)
+ if m: extra['bio'] = m.group(1).strip()
+
+ img = re.search(r'<meta property="og:image" content="([^"]+)"', response.text)
+ if img: extra['avatar'] = img.group(1)
+
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/social/instagram.py b/user_scanner/user_scan/social/instagram.py
index 3662099..97b0dee 100644
--- a/user_scanner/user_scan/social/instagram.py
+++ b/user_scanner/user_scan/social/instagram.py
@@ -1,46 +1,141 @@
import httpx
-
+import re
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import generic_validate
-from user_scanner.core.result import Result
+from user_scanner.core.orchestrator import Result, make_request
+
+
+def validate_instagram(user: str) -> Result:
+ if not (1 <= len(user) <= 30):
+ return Result.error("Length must be between 1 and 30 characters")
+ if not re.match(r"^[a-zA-Z0-9._-]+$", user):
+ return Result.error(
+ "Can only use letters, numbers, underscores, periods, or hyphens"
+ )
-def validate_instagram(user):
show_url = f"https://www.instagram.com/{user}/"
- url = "https://www.instagram.com/api/v1/web/accounts/web_create_ajax/attempt/"
+ api_url = f"https://www.instagram.com/api/v1/users/web_profile_info/?username={user}"
headers = {
"User-Agent": get_random_user_agent(),
"Accept": "*/*",
"x-ig-app-id": "936619743392459",
- "x-csrftoken": "0",
- "x-requested-with": "XMLHttpRequest",
- "referer": "https://www.instagram.com/accounts/emailsignup/",
- "content-type": "application/x-www-form-urlencoded",
- "cookie": "csrftoken=0",
+ "referer": show_url,
}
- def check_response(response: httpx.Response) -> Result:
- try:
- data = response.json()
- except Exception:
- return Result.error(f"[{response.status_code}] Unexpected response from Instagram.")
-
- errors = data.get("errors", {})
- username_errors = errors.get("username", [])
-
- for err in username_errors:
- if err.get("code") in ("username_invalid", "username_is_taken"):
- return Result.taken()
-
- return Result.available()
-
- return generic_validate(
- url,
- check_response,
- show_url=show_url,
- headers=headers,
- data={"username": user, "email": "", "first_name": "", "opt_into_one_tap": "false"},
- method="POST",
- http2=True,
- )
+ try:
+ response = make_request(
+ api_url, headers=headers, http2=True, timeout=10)
+
+ if response.status_code == 200:
+ try:
+ data = response.json()
+ except Exception:
+ data = {}
+
+ user_data = data.get("data", {}).get("user")
+ if user_data:
+ extra = {}
+
+ # Base Fields
+ if user_data.get("username"):
+ extra["username"] = user_data.get("username")
+ if user_data.get("full_name"):
+ extra["fullname"] = user_data.get("full_name")
+ if user_data.get("id"):
+ extra["id"] = user_data.get("id")
+ if user_data.get("profile_pic_url_hd"):
+ extra["image"] = user_data.get("profile_pic_url_hd")
+ if user_data.get("biography"):
+ extra["bio"] = user_data.get("biography")
+
+ # Advanced/External Fields
+ if user_data.get("business_email"):
+ extra["business_email"] = user_data.get("business_email")
+ if user_data.get("external_url"):
+ extra["external_url"] = user_data.get("external_url")
+ if user_data.get("fbid"):
+ extra["facebook_uid"] = user_data.get("fbid")
+
+ # Boolean Flags
+ if user_data.get("is_business_account") is not None:
+ extra["is_business"] = str(
+ user_data.get("is_business_account"))
+ if user_data.get("is_joined_recently") is not None:
+ extra["is_joined_recently"] = str(
+ user_data.get("is_joined_recently"))
+ if user_data.get("is_private") is not None:
+ extra["private"] = str(user_data.get("is_private"))
+ if user_data.get("is_verified") is not None:
+ extra["verified"] = str(user_data.get("is_verified"))
+
+ # Social Metrics
+ if user_data.get("edge_followed_by", {}).get("count") is not None:
+ extra["follower_count"] = user_data.get(
+ "edge_followed_by", {}).get("count")
+ if user_data.get("edge_follow", {}).get("count") is not None:
+ extra["following_count"] = user_data.get(
+ "edge_follow", {}).get("count")
+
+ return Result.taken(extra=extra, url=show_url)
+ else:
+ # If API response succeeded but user object is empty/null, the user does not exist
+ return Result.available(url=show_url)
+
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+
+ elif response.status_code in (403, 429):
+ signup_url = "https://www.instagram.com/api/v1/web/accounts/web_create_ajax/attempt/"
+ signup_headers = {
+ "User-Agent": headers["User-Agent"],
+ "Accept": "*/*",
+ "x-ig-app-id": "936619743392459",
+ "x-csrftoken": "0",
+ "x-requested-with": "XMLHttpRequest",
+ "referer": "https://www.instagram.com/accounts/emailsignup/",
+ "content-type": "application/x-www-form-urlencoded",
+ "cookie": "csrftoken=0",
+ }
+
+ signup_data = {
+ "username": user,
+ "email": "",
+ "first_name": "",
+ "opt_into_one_tap": "false"
+ }
+
+ try:
+ fallback_resp = make_request(
+ signup_url,
+ headers=signup_headers,
+ data=signup_data,
+ method="POST",
+ http2=True,
+ timeout=10
+ )
+
+ if fallback_resp.status_code == 200:
+ fb_data = fallback_resp.json()
+ errors = fb_data.get("errors", {})
+ username_errors = errors.get("username", [])
+
+ for err in username_errors:
+ if err.get("code") in ("username_invalid", "username_is_taken"):
+ return Result.taken(url=show_url)
+
+ return Result.available(url=show_url)
+ except Exception:
+ pass
+
+ # If the fallback signup attempt also fails or gets blocked, notify the user gracefully
+ return Result.error(
+ f"Rate limit / Cloudflare protection block (HTTP {response.status_code}). Run with residential proxy or active session cookies.",
+ url=show_url
+ )
+
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/social/x.py b/user_scanner/user_scan/social/x.py
index 5600fa2..5da0cf6 100644
--- a/user_scanner/user_scan/social/x.py
+++ b/user_scanner/user_scan/social/x.py
@@ -1,39 +1,59 @@
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import generic_validate
-from user_scanner.core.result import Result
-
+from user_scanner.core.orchestrator import Result, make_request
def validate_x(user):
- url = "https://api.twitter.com/i/users/username_available.json"
show_url = f"https://x.com/{user}"
+ # Try to get rich data from vxtwitter API first
+ vx_url = f"https://api.vxtwitter.com/{user}"
+ vx_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",
+ }
+
+ try:
+ vx_response = make_request(vx_url, headers=vx_headers, follow_redirects=True)
+ if vx_response.status_code == 200:
+ data = vx_response.json()
+ extra = {}
+ if name := data.get("name"): extra["name"] = name
+ if bio := data.get("description"): extra["bio"] = bio
+ if loc := data.get("location"): extra["location"] = loc
+ if created := data.get("created_at"): extra["created_at"] = created
+ if followers := data.get("followers_count"): extra["followers"] = str(followers)
+ if following := data.get("following_count"): extra["following"] = str(following)
+ if avatar := data.get("profile_image_url"): extra["avatar"] = avatar.replace("_normal", "")
+ if protected := data.get("protected"): extra["protected"] = str(protected)
+ if tweets := data.get("tweet_count"): extra["tweets"] = str(tweets)
+
+ return Result.taken(extra=extra, url=show_url)
+ except Exception:
+ pass
+
+ # Fallback to checking username availability directly via Twitter API
+ url = "https://api.twitter.com/i/users/username_available.json"
params = {"username": user, "full_name": "John Doe", "email": "[email protected]"}
-
headers = {
"Authority": "api.twitter.com",
"User-Agent": get_random_user_agent(),
}
- def process(response):
+ try:
+ response = make_request(url, params=params, headers=headers, follow_redirects=True)
status = response.status_code
if status in [401, 403, 429]:
- return Result.error()
+ return Result.error("Twitter rate limit or blocked", url=show_url)
elif status == 200:
data = response.json()
if data.get("valid") is True:
- return Result.available()
+ return Result.available(url=show_url)
elif data.get("reason") == "taken":
- return Result.taken()
- elif (
- data.get("reason") == "improper_format"
- or data.get("reason") == "invalid_username"
- ):
- return Result.error(f"X says: {data.get('desc')}")
-
- return Result.error()
+ return Result.taken(url=show_url)
+ elif data.get("reason") in ["improper_format", "invalid_username"]:
+ return Result.error(f"X says: {data.get('desc')}", url=show_url)
- return generic_validate(
- url, process, show_url=show_url, params=params, headers=headers
- )
+ return Result.error(f"Unexpected status: {status}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)
diff --git a/user_scanner/user_scan/social/youtube.py b/user_scanner/user_scan/social/youtube.py
index 636de95..fee6d13 100644
--- a/user_scanner/user_scan/social/youtube.py
+++ b/user_scanner/user_scan/social/youtube.py
@@ -1,39 +1,46 @@
from user_scanner.core.helpers import get_random_user_agent
-from user_scanner.core.orchestrator import Result, status_validate
+from user_scanner.core.orchestrator import Result, make_request
+import re, json
def validate_youtube(user) -> Result:
- url = f"https://m.youtube.com/@{user}"
+ url = f"https://www.youtube.com/@{user}"
show_url = f"https://youtube.com/@{user}"
headers = {
- "User-Agent": get_random_user_agent(),
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
- "Accept-Encoding": "identity",
- "sec-ch-dpr": "2.75",
- "sec-ch-viewport-width": "980",
- "sec-ch-ua": '"Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"',
- "sec-ch-ua-mobile": "?1",
- "sec-ch-ua-full-version": '"143.0.7499.52"',
- "sec-ch-ua-arch": '""',
- "sec-ch-ua-platform": '"Android"',
- "sec-ch-ua-platform-version": '"15.0.0"',
- "sec-ch-ua-model": '"I2404"',
- "sec-ch-ua-bitness": '""',
- "sec-ch-ua-wow64": "?0",
- "sec-ch-ua-full-version-list": '"Google Chrome";v="143.0.7499.52", "Chromium";v="143.0.7499.52", "Not A(Brand";v="24.0.0.0"',
- "sec-ch-ua-form-factors": '"Mobile"',
- "upgrade-insecure-requests": "1",
- "x-browser-channel": "stable",
- "x-browser-year": "2025",
- "x-browser-copyright": "Copyright 2025 Google LLC. All Rights reserved.",
- "sec-fetch-site": "none",
- "sec-fetch-mode": "navigate",
- "sec-fetch-user": "?1",
- "sec-fetch-dest": "document",
- "accept-language": "en-US,en;q=0.9",
- "priority": "u=0, i",
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
+ "Accept-Language": "en-US,en;q=0.9",
}
- return status_validate(
- url, 404, 200, show_url=show_url, headers=headers, follow_redirects=True
- )
+ try:
+ response = make_request(url, headers=headers, follow_redirects=True)
+ if response.status_code == 200:
+ if "This channel does not exist" in response.text or "404 Not Found" in response.text:
+ return Result.available(url=show_url)
+
+ extra = {}
+ m = re.search(r'var ytInitialData = (\{.*?\});', response.text)
+ if m:
+ try:
+ data = json.loads(m.group(1))
+ meta = data.get('metadata', {}).get('channelMetadataRenderer', {})
+ if title := meta.get('title'): extra['fullname'] = title
+ if desc := meta.get('description'): extra['bio'] = desc
+ if cid := meta.get('externalId'): extra['youtube_channel_id'] = cid
+ if purl := meta.get('vanityChannelUrl'): extra['channel_url'] = purl
+ if safe := meta.get('isFamilySafe'): extra['is_family_safe'] = str(safe)
+ if kw := meta.get('keywords'): extra['keywords'] = kw
+ if thumbs := meta.get('avatar', {}).get('thumbnails'):
+ if len(thumbs) > 0: extra['image'] = thumbs[0].get('url')
+ except Exception:
+ pass
+
+ subs = re.search(r'\"content\":\"([0-9.]+[A-Z]? subscribers)\"', response.text)
+ if subs: extra['subscribers'] = subs.group(1)
+
+ return Result.taken(extra=extra, url=show_url)
+ elif response.status_code == 404:
+ return Result.available(url=show_url)
+ else:
+ return Result.error(f"Unexpected status: {response.status_code}", url=show_url)
+ except Exception as e:
+ return Result.error(e, url=show_url)