user-scanner 1.0.1.4__py3-none-any.whl → 1.0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. user_scanner/__init__.py +1 -0
  2. user_scanner/__main__.py +19 -10
  3. user_scanner/cli/__init__.py +0 -0
  4. user_scanner/cli/banner.py +32 -0
  5. user_scanner/community/coderlegion.py +5 -26
  6. user_scanner/core/orchestrator.py +98 -50
  7. user_scanner/creator/devto.py +3 -23
  8. user_scanner/creator/itch_io.py +22 -0
  9. user_scanner/creator/kaggle.py +3 -22
  10. user_scanner/creator/patreon.py +2 -24
  11. user_scanner/creator/producthunt.py +40 -0
  12. user_scanner/dev/codeberg.py +3 -23
  13. user_scanner/dev/cratesio.py +9 -24
  14. user_scanner/dev/dockerhub.py +7 -25
  15. user_scanner/dev/github.py +16 -31
  16. user_scanner/dev/gitlab.py +8 -22
  17. user_scanner/dev/launchpad.py +9 -24
  18. user_scanner/dev/replit.py +3 -23
  19. user_scanner/donation/__init__.py +0 -0
  20. user_scanner/donation/buymeacoffee.py +21 -0
  21. user_scanner/gaming/chess_com.py +6 -19
  22. user_scanner/gaming/monkeytype.py +6 -19
  23. user_scanner/gaming/osu.py +2 -24
  24. user_scanner/gaming/roblox.py +5 -18
  25. user_scanner/gaming/steam.py +30 -0
  26. user_scanner/social/bluesky.py +6 -19
  27. user_scanner/social/instagram.py +12 -27
  28. user_scanner/social/mastodon.py +2 -24
  29. user_scanner/social/pinterest.py +4 -20
  30. user_scanner/social/reddit.py +4 -20
  31. user_scanner/social/snapchat.py +5 -20
  32. user_scanner/social/telegram.py +4 -11
  33. user_scanner/social/threads.py +13 -28
  34. user_scanner/utils/version.py +20 -0
  35. user_scanner/version.json +4 -0
  36. {user_scanner-1.0.1.4.dist-info → user_scanner-1.0.5.0.dist-info}/METADATA +45 -10
  37. user_scanner-1.0.5.0.dist-info/RECORD +52 -0
  38. user_scanner-1.0.1.4.dist-info/RECORD +0 -43
  39. {user_scanner-1.0.1.4.dist-info → user_scanner-1.0.5.0.dist-info}/WHEEL +0 -0
  40. {user_scanner-1.0.1.4.dist-info → user_scanner-1.0.5.0.dist-info}/entry_points.txt +0 -0
  41. {user_scanner-1.0.1.4.dist-info → user_scanner-1.0.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,38 +1,23 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_github(user):
5
- url = f"https://github.com/signup_check/username?value={user}"
4
+ url = f"https://github.com/signup_check/username?value={user}"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36",
9
- 'Accept-Encoding': "gzip, deflate, br, zstd",
10
- 'sec-ch-ua-platform': "\"Linux\"",
11
- 'sec-ch-ua': "\"Chromium\";v=\"140\", \"Not=A?Brand\";v=\"24\", \"Google Chrome\";v=\"140\"",
12
- 'sec-ch-ua-mobile': "?0",
13
- 'sec-fetch-site': "same-origin",
14
- 'sec-fetch-mode': "cors",
15
- 'sec-fetch-dest': "empty",
16
- 'referer': "https://github.com/signup?source=form-home-signup&user_email=",
17
- 'accept-language': "en-US,en;q=0.9",
18
- 'priority': "u=1, i"
19
- }
6
+ headers = {
7
+ 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36",
8
+ 'Accept-Encoding': "gzip, deflate, br, zstd",
9
+ 'sec-ch-ua-platform': "\"Linux\"",
10
+ 'sec-ch-ua': "\"Chromium\";v=\"140\", \"Not=A?Brand\";v=\"24\", \"Google Chrome\";v=\"140\"",
11
+ 'sec-ch-ua-mobile': "?0",
12
+ 'sec-fetch-site': "same-origin",
13
+ 'sec-fetch-mode': "cors",
14
+ 'sec-fetch-dest': "empty",
15
+ 'referer': "https://github.com/signup?source=form-home-signup&user_email=",
16
+ 'accept-language': "en-US,en;q=0.9",
17
+ 'priority': "u=1, i"
18
+ }
20
19
 
21
- try:
22
- response = httpx.get(url, headers=headers, timeout = 3.0)
23
- status = response.status_code
24
-
25
- if status == 200:
26
- return 1
27
- elif status == 422:
28
- return 0
29
- else:
30
- return 2
31
-
32
- except (ConnectError, TimeoutException):
33
- return 2
34
- except Exception:
35
- return 2
20
+ return status_validate(url, 200, 422, headers = headers)
36
21
 
37
22
  if __name__ == "__main__":
38
23
  user = input ("Username?: ").strip()
@@ -1,23 +1,18 @@
1
- import httpx
2
- import json
3
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import generic_validate
4
2
 
5
3
  def validate_gitlab(user):
6
4
  url = f"https://gitlab.com/users/{user}/exists"
7
5
 
8
6
  headers = {
9
- 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
10
- 'Accept': "application/json, text/plain, */*",
11
- 'X-Requested-With': "XMLHttpRequest",
12
- 'Referer': "https://gitlab.com/users/sign_up",
7
+ 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
8
+ 'Accept': "application/json, text/plain, */*",
9
+ 'X-Requested-With': "XMLHttpRequest",
10
+ 'Referer': "https://gitlab.com/users/sign_up",
13
11
  }
14
12
 
15
- try:
16
- response = httpx.get(url, headers=headers, timeout=3.0)
17
-
13
+ def process(response):
18
14
  if response.status_code == 200:
19
15
  data = response.json()
20
-
21
16
  if 'exists' in data:
22
17
  # Corrected: Compare against Python boolean True/False
23
18
  # AVAILABLE (return 1) if "exists": true
@@ -26,18 +21,9 @@ def validate_gitlab(user):
26
21
  # UNAVAILABLE (return 0) if "exists": false
27
22
  elif data['exists'] is True:
28
23
  return 0
29
-
30
- return 2
31
-
32
- else:
33
- return 2
34
-
35
- except (ConnectError, TimeoutException):
36
- return 2
37
- except json.JSONDecodeError:
38
- return 2
39
- except Exception:
40
24
  return 2
25
+
26
+ return generic_validate(url, process, headers = headers)
41
27
 
42
28
  if __name__ == "__main__":
43
29
  user = input ("Username?: ").strip()
@@ -1,31 +1,16 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_launchpad(user):
5
- url = f"https://launchpad.net/~{user}"
4
+ url = f"https://launchpad.net/~{user}"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
9
- 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9",
10
- 'Accept-Encoding': "gzip, deflate, br, zstd",
11
- 'Upgrade-Insecure-Requests': "1",
12
- }
6
+ headers = {
7
+ 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
8
+ 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9",
9
+ 'Accept-Encoding': "gzip, deflate, br, zstd",
10
+ 'Upgrade-Insecure-Requests': "1",
11
+ }
13
12
 
14
- try:
15
- response = httpx.head(url, headers=headers, timeout=5.0, follow_redirects=True)
16
- status = response.status_code
17
-
18
- if status == 200:
19
- return 0
20
- elif status == 404:
21
- return 1
22
- else:
23
- return 2
24
-
25
- except (ConnectError, TimeoutException):
26
- return 2
27
- except Exception:
28
- return 2
13
+ return status_validate(url, 404, 200, headers = headers, follow_redirects=True)
29
14
 
30
15
  if __name__ == "__main__":
31
16
  user = input ("Username?: ").strip()
@@ -1,29 +1,9 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_replit(user):
5
- url = f"https://replit.com/@{user}"
4
+ url = f"https://replit.com/@{user}"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
9
- 'Accept': "text/html",
10
- }
11
-
12
- try:
13
- response = httpx.head(url, headers=headers, timeout=3.0, follow_redirects=True)
14
- status = response.status_code
15
-
16
- if status == 200:
17
- return 0
18
- elif status == 404:
19
- return 1
20
- else:
21
- return 2
22
-
23
- except (ConnectError, TimeoutException):
24
- return 2
25
- except Exception:
26
- return 2
6
+ return status_validate(url, 404, 200, follow_redirects = True)
27
7
 
28
8
  if __name__ == "__main__":
29
9
  user = input ("Username?: ").strip()
File without changes
@@ -0,0 +1,21 @@
1
+ import httpx
2
+ from httpx import ConnectError, TimeoutException
3
+
4
+ from ..core.orchestrator import status_validate
5
+
6
+ def validate_buymeacoffee(user):
7
+ url = f"https://buymeacoffee.com/{user}"
8
+
9
+ return status_validate(url, 404, 200, follow_redirects = True)
10
+
11
+
12
+ if __name__ == "__main__":
13
+ user = input ("Username?: ").strip()
14
+ result = validate_buymeacoffee(user)
15
+
16
+ if result == 1:
17
+ print("Available!")
18
+ elif result == 0:
19
+ print("Unavailable!")
20
+ else:
21
+ print("Error occurred!")
@@ -1,6 +1,4 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
3
- import json
1
+ from ..core.orchestrator import generic_validate
4
2
 
5
3
  def validate_chess_com(user):
6
4
  url = f"https://www.chess.com/callback/user/valid?username={user}"
@@ -8,15 +6,12 @@ def validate_chess_com(user):
8
6
  headers = {
9
7
  'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
10
8
  'Accept': "application/json, text/plain, */*",
11
- 'Accept-Encoding': "gzip, deflate, br",
9
+ 'Accept-Encoding': "identity",
12
10
  'Accept-Language': "en-US,en;q=0.9",
13
11
  }
14
12
 
15
- try:
16
- response = httpx.get(url, headers=headers, timeout = 3.0)
17
- status = response.status_code
18
-
19
- if status == 200:
13
+ def process(response):
14
+ if response.status_code == 200:
20
15
  data = response.json()
21
16
  if data.get('valid') is True:
22
17
  # 'valid': true means the username is NOT taken
@@ -24,18 +19,10 @@ def validate_chess_com(user):
24
19
  elif data.get('valid') is False:
25
20
  # 'valid': false means the username IS taken
26
21
  return 0
27
- else:
28
- return 2
29
- else:
30
- return 2
31
-
32
- except (ConnectError, TimeoutException):
33
- return 2
34
- except json.JSONDecodeError:
35
- return 2
36
- except Exception:
37
22
  return 2
38
23
 
24
+ return generic_validate(url, process, headers = headers)
25
+
39
26
  if __name__ == "__main__":
40
27
  try:
41
28
  import httpx
@@ -1,6 +1,4 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
3
- import json
1
+ from ..core.orchestrator import generic_validate
4
2
 
5
3
  def validate_monkeytype(user: str) -> int:
6
4
 
@@ -13,15 +11,12 @@ def validate_monkeytype(user: str) -> int:
13
11
  "Chrome/128.0.0.0 Safari/537.36"
14
12
  ),
15
13
  "Accept": "application/json, text/plain, */*",
16
- "Accept-Encoding": "gzip, deflate, br",
14
+ "Accept-Encoding": "identity",
17
15
  "Accept-Language": "en-US,en;q=0.9",
18
16
  }
19
17
 
20
- try:
21
- response = httpx.get(url, headers=headers, timeout=3.0)
22
- status = response.status_code
23
-
24
- if status == 200:
18
+ def process(response):
19
+ if response.status_code == 200:
25
20
  data = response.json()
26
21
  # Expected shape:
27
22
  # { "message": "string", "data": { "available": true/false } }
@@ -32,18 +27,10 @@ def validate_monkeytype(user: str) -> int:
32
27
  return 1
33
28
  elif available is False:
34
29
  return 0
35
- else:
36
- return 2
37
- else:
38
- return 2
39
-
40
- except (ConnectError, TimeoutException):
41
- return 2
42
- except json.JSONDecodeError:
43
- return 2
44
- except Exception:
45
30
  return 2
31
+
46
32
 
33
+ return generic_validate(url, process, headers = headers)
47
34
 
48
35
  if __name__ == "__main__":
49
36
  try:
@@ -1,5 +1,4 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_osu(user):
5
4
  """
@@ -9,28 +8,7 @@ def validate_osu(user):
9
8
 
10
9
  url = f"https://osu.ppy.sh/users/{user}"
11
10
 
12
- headers = {
13
- 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
14
- 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
15
- 'Accept-Encoding': "gzip, deflate, br",
16
- 'Accept-Language': "en-US,en;q=0.9",
17
- 'sec-fetch-dest': "document",
18
- }
19
-
20
- try:
21
- response = httpx.get(url, headers = headers, timeout = 5.0, follow_redirects = True)
22
- status = response.status_code
23
-
24
- if status == 200:
25
- return 0
26
- elif status == 404:
27
- return 1
28
- else:
29
- return 2
30
- except (ConnectError, TimeoutException):
31
- return 2
32
- except Exception:
33
- return 2
11
+ return status_validate(url, 404, [200, 302], follow_redirects = True)
34
12
 
35
13
  if __name__ == "__main__":
36
14
  user = input ("Username?: ").strip()
@@ -1,5 +1,4 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import generic_validate
3
2
 
4
3
  def validate_roblox(user):
5
4
  """
@@ -9,31 +8,19 @@ def validate_roblox(user):
9
8
 
10
9
  url = f"https://users.roblox.com/v1/users/search?keyword={user}&limit=10" # official api
11
10
 
12
- headers = {
13
- 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
14
- 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
15
- 'Accept-Encoding': "gzip, deflate, br",
16
- 'Accept-Language': "en-US,en;q=0.9",
17
- 'sec-fetch-dest': "document",
18
- }
19
-
20
- try:
21
- response = httpx.get(url, headers = headers, timeout = 5.5, follow_redirects = True)
22
- status = response.status_code
11
+ def process(response):
23
12
  search_results = response.json() # api response
24
13
 
25
14
  if "errors" in search_results: # this usually triggers when timeout or ratelimit
26
15
  return 2
27
16
 
28
17
  for entry in search_results["data"]: # iterates through the entries in the search results
29
- if entry["name"] == user: # if a username matches the user
18
+ # .lower() so casing from the API doesn't matter
19
+ if entry["name"].lower() == user.lower(): # if a username matches the user
30
20
  return 0
31
21
  return 1
32
22
 
33
- except (ConnectError, TimeoutException):
34
- return 2
35
- except Exception as e:
36
- return 2
23
+ return generic_validate(url, process, follow_redirects = True)
37
24
 
38
25
  if __name__ == "__main__":
39
26
  user = input ("Username?: ").strip()
@@ -0,0 +1,30 @@
1
+ from ..core.orchestrator import generic_validate
2
+
3
+ def validate_steam(user):
4
+ """
5
+ Checks if a steam username is available.
6
+ Returns: 1 -> available, 0 -> taken, 2 -> error
7
+ """
8
+
9
+ url = f"https://steamcommunity.com/id/{user}/"
10
+
11
+ def process(response):
12
+ if response.status_code == 200:
13
+ if response.text.find("Error</title>") != -1:
14
+ return 1
15
+ else:
16
+ return 0
17
+ return 2
18
+
19
+ return generic_validate(url, process)
20
+
21
+ if __name__ == "__main__":
22
+ user = input ("Username?: ").strip()
23
+ result = validate_steam(user)
24
+
25
+ if result == 1:
26
+ print("Available!")
27
+ elif result == 0:
28
+ print("Unavailable!")
29
+ else:
30
+ print("Error occurred!")
@@ -1,7 +1,5 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
3
1
  import re
4
- import json
2
+ from ..core.orchestrator import generic_validate
5
3
 
6
4
  def validate_bluesky(user):
7
5
  handle = user if user.endswith('.bsky.social') else f"{user}.bsky.social"
@@ -28,12 +26,9 @@ def validate_bluesky(user):
28
26
 
29
27
  if not re.fullmatch(r"^[a-zA-Z0-9\.-]{1,64}$", user):
30
28
  return 2
31
-
32
- try:
33
- response = httpx.get(url, headers=headers, params=params, timeout = 15.0)
34
- status = response.status_code
35
-
36
- if status == 200:
29
+
30
+ def process(response):
31
+ if response.status_code == 200:
37
32
  data = response.json()
38
33
  result_type = data.get('result', {}).get('$type')
39
34
 
@@ -41,18 +36,10 @@ def validate_bluesky(user):
41
36
  return 1
42
37
  elif result_type == "com.atproto.temp.checkHandleAvailability#resultUnavailable":
43
38
  return 0
44
- else:
45
- return 2
46
- else:
47
- return 2
48
-
49
- except (ConnectError, TimeoutException):
50
- return 2
51
- except json.JSONDecodeError:
52
- return 2
53
- except Exception:
54
39
  return 2
55
40
 
41
+ return generic_validate(url, process, headers = headers, params = params, timeout = 15.0)
42
+
56
43
  if __name__ == "__main__":
57
44
  try:
58
45
  import httpx
@@ -1,34 +1,19 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_instagram(user):
5
- url = f"https://www.instagram.com/api/v1/users/web_profile_info/?username={user}"
4
+ url = f"https://www.instagram.com/api/v1/users/web_profile_info/?username={user}"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
9
- 'X-IG-App-ID': "936619743392459",
10
- 'Accept': "application/json, text/javascript, */*; q=0.01",
11
- 'Accept-Encoding': "gzip, deflate, br",
12
- 'Accept-Language': "en-US,en;q=0.9",
13
- 'X-Requested-With': "XMLHttpRequest",
14
- 'Referer': f"https://www.instagram.com/{user}/",
15
- }
6
+ headers = {
7
+ 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
8
+ 'X-IG-App-ID': "936619743392459",
9
+ 'Accept': "application/json, text/javascript, */*; q=0.01",
10
+ 'Accept-Encoding': "gzip, deflate, br",
11
+ 'Accept-Language': "en-US,en;q=0.9",
12
+ 'X-Requested-With': "XMLHttpRequest",
13
+ 'Referer': f"https://www.instagram.com/{user}/",
14
+ }
16
15
 
17
- try:
18
- response = httpx.get(url, headers=headers, timeout = 3.0)
19
- status = response.status_code
20
-
21
- if status == 200:
22
- return 0
23
- elif status == 404:
24
- return 1
25
- else:
26
- return 2
27
-
28
- except (ConnectError, TimeoutException):
29
- return 2
30
- except Exception:
31
- return 2
16
+ return status_validate(url, 404, 200, headers = headers)
32
17
 
33
18
  if __name__ == "__main__":
34
19
  user = input ("Username?: ").strip()
@@ -1,31 +1,9 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_mastodon(user):
5
4
  url = f"https://mastodon.social/@{user}"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
9
- '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",
10
- 'Accept-Encoding': "gzip, deflate, br",
11
- 'Accept-Language': "en-US,en;q=0.9",
12
- }
13
-
14
- try:
15
- response = httpx.get(url, headers=headers, timeout = 3.0, follow_redirects=True)
16
- status = response.status_code
17
-
18
- if status == 200:
19
- return 0
20
- elif status == 404:
21
- return 1
22
- else:
23
- return 2
24
-
25
- except (ConnectError, TimeoutException):
26
- return 2
27
- except Exception:
28
- return 2
6
+ return status_validate(url, 404, 200, follow_redirects = True)
29
7
 
30
8
  if __name__ == "__main__":
31
9
  try:
@@ -1,34 +1,18 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import generic_validate
3
2
 
4
3
  def validate_pinterest(user):
5
4
  url = f"https://www.pinterest.com/{user}/"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
9
- 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
10
- 'Accept-Encoding': "gzip",
11
- 'Accept-Language': "en-US,en;q=0.9",
12
- 'sec-fetch-dest': "document",
13
- }
14
-
15
- NOT_FOUND_STRING = "User not found."
16
-
17
- try:
18
- response = httpx.get(url, headers=headers, follow_redirects=True, timeout = 3.0)
19
-
6
+ def process(response):
20
7
  if response.status_code == 200:
21
- if NOT_FOUND_STRING in response.text:
8
+ if "User not found." in response.text:
22
9
  return 1
23
10
  else:
24
11
  return 0
25
12
  else:
26
13
  return 2
27
14
 
28
- except (ConnectError, TimeoutException):
29
- return 2
30
- except Exception:
31
- return 2
15
+ return generic_validate(url, process, follow_redirects = True)
32
16
 
33
17
  if __name__ == "__main__":
34
18
  user = input ("Username?: ").strip()
@@ -1,34 +1,18 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import generic_validate
3
2
 
4
3
  def validate_reddit(user):
5
4
  url = f"https://www.reddit.com/user/{user}/"
6
5
 
7
- headers = {
8
- 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
9
- 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
10
- 'Accept-Encoding': "gzip, deflate, br",
11
- 'Accept-Language': "en-US,en;q=0.9",
12
- 'sec-fetch-dest': "document",
13
- }
14
-
15
- NOT_FOUND_STRING = "Sorry, nobody on Reddit goes by that name."
16
-
17
- try:
18
- response = httpx.get(url, headers=headers, follow_redirects=True, timeout = 3.0)
19
-
6
+ def process(response):
20
7
  if response.status_code == 200:
21
- if NOT_FOUND_STRING in response.text:
8
+ if "Sorry, nobody on Reddit goes by that name." in response.text:
22
9
  return 1
23
10
  else:
24
11
  return 0
25
12
  else:
26
13
  return 2
27
14
 
28
- except (ConnectError, TimeoutException):
29
- return 2
30
- except Exception:
31
- return 2
15
+ return generic_validate(url, process, follow_redirects = True)
32
16
 
33
17
  if __name__ == "__main__":
34
18
  user = input ("Username?: ").strip()
@@ -1,10 +1,9 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from ..core.orchestrator import status_validate
3
2
 
4
3
  def validate_snapchat(user):
5
- url = f"https://www.snapchat.com/@{user}"
4
+ url = f"https://www.snapchat.com/@{user}"
6
5
 
7
- headers = {
6
+ headers = {
8
7
  'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
9
8
  '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",
10
9
  'Accept-Encoding': "gzip, deflate, br, zstd",
@@ -18,23 +17,9 @@ def validate_snapchat(user):
18
17
  'sec-fetch-dest': "document",
19
18
  'accept-language': "en-US,en;q=0.9",
20
19
  'priority': "u=0, i"
21
- }
20
+ }
22
21
 
23
- try:
24
- response = httpx.get(url, headers=headers, follow_redirects=True, timeout = 3.0)
25
- status = response.status_code
26
-
27
- if status == 200:
28
- return 0
29
- elif status == 404:
30
- return 1
31
- else:
32
- return 2
33
-
34
- except (ConnectError, TimeoutException):
35
- return 2
36
- except Exception:
37
- return 2
22
+ return status_validate(url, 404, 200, headers = headers, follow_redirects = True)
38
23
 
39
24
  if __name__ == "__main__":
40
25
  user = input ("Username?: ").strip()