user-scanner 1.0.5.0__py3-none-any.whl → 1.0.6.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 (48) hide show
  1. user_scanner/__init__.py +0 -1
  2. user_scanner/__main__.py +17 -12
  3. user_scanner/cli/banner.py +2 -0
  4. user_scanner/community/coderlegion.py +15 -14
  5. user_scanner/core/orchestrator.py +18 -10
  6. user_scanner/creator/devto.py +13 -11
  7. user_scanner/creator/hashnode.py +19 -17
  8. user_scanner/creator/itch_io.py +12 -10
  9. user_scanner/creator/kaggle.py +12 -11
  10. user_scanner/creator/medium.py +11 -10
  11. user_scanner/creator/patreon.py +17 -15
  12. user_scanner/creator/producthunt.py +16 -14
  13. user_scanner/dev/codeberg.py +13 -11
  14. user_scanner/dev/cratesio.py +19 -17
  15. user_scanner/dev/dockerhub.py +17 -15
  16. user_scanner/dev/github.py +26 -24
  17. user_scanner/dev/gitlab.py +14 -12
  18. user_scanner/dev/launchpad.py +19 -17
  19. user_scanner/dev/npmjs.py +22 -19
  20. user_scanner/dev/replit.py +13 -11
  21. user_scanner/donation/buymeacoffee.py +11 -10
  22. user_scanner/donation/liberapay.py +36 -0
  23. user_scanner/gaming/chess_com.py +20 -18
  24. user_scanner/gaming/minecraft.py +24 -0
  25. user_scanner/gaming/monkeytype.py +4 -3
  26. user_scanner/gaming/osu.py +14 -12
  27. user_scanner/gaming/roblox.py +20 -16
  28. user_scanner/gaming/steam.py +12 -10
  29. user_scanner/social/bluesky.py +20 -18
  30. user_scanner/social/discord.py +12 -13
  31. user_scanner/social/instagram.py +22 -20
  32. user_scanner/social/mastodon.py +17 -15
  33. user_scanner/social/pinterest.py +13 -11
  34. user_scanner/social/reddit.py +13 -11
  35. user_scanner/social/snapchat.py +28 -26
  36. user_scanner/social/telegram.py +13 -11
  37. user_scanner/social/threads.py +23 -21
  38. user_scanner/social/x.py +14 -12
  39. user_scanner/social/youtube.py +37 -34
  40. user_scanner/utils/update.py +0 -0
  41. user_scanner/utils/version.py +2 -0
  42. user_scanner/version.json +1 -1
  43. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.6.0.dist-info}/METADATA +6 -7
  44. user_scanner-1.0.6.0.dist-info/RECORD +55 -0
  45. user_scanner-1.0.5.0.dist-info/RECORD +0 -52
  46. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.6.0.dist-info}/WHEEL +0 -0
  47. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.6.0.dist-info}/entry_points.txt +0 -0
  48. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.6.0.dist-info}/licenses/LICENSE +0 -0
user_scanner/__init__.py CHANGED
@@ -1 +0,0 @@
1
-
user_scanner/__main__.py CHANGED
@@ -14,6 +14,7 @@ CATEGORY_MAPPING = {
14
14
  "donation": "donation"
15
15
  }
16
16
 
17
+
17
18
  def list_modules(category=None):
18
19
  from user_scanner import dev, social, creator, community, gaming, donation
19
20
  packages = {
@@ -30,11 +31,13 @@ def list_modules(category=None):
30
31
  for cat_name in categories_to_list:
31
32
  package = packages[cat_name]
32
33
  modules = load_modules(package)
33
- print(Fore.MAGENTA + f"\n== {cat_name.upper()} SITES =={Style.RESET_ALL}")
34
+ print(Fore.MAGENTA +
35
+ f"\n== {cat_name.upper()} SITES =={Style.RESET_ALL}")
34
36
  for module in modules:
35
37
  site_name = module.__name__.split(".")[-1]
36
38
  print(f" - {site_name}")
37
39
 
40
+
38
41
  def main():
39
42
  parser = argparse.ArgumentParser(
40
43
  prog="user-scanner",
@@ -60,26 +63,26 @@ def main():
60
63
  args = parser.parse_args()
61
64
 
62
65
  if args.module and "." in args.module:
63
- args.module = args.module.replace(".", "_")
66
+ args.module = args.module.replace(".", "_")
64
67
 
65
68
  if args.list:
66
69
  list_modules(args.category)
67
70
  return
68
71
 
69
-
70
72
  # Special username checks before run
71
73
  if (args.module == "x" or args.category == "social"):
72
- if re.search(r"[^a-zA-Z0-9._-]", args.username):
73
- print(Fore.RED + f"[!] Username '{args.username}' contains unsupported special characters. X (Twitter) doesn't support these." + Style.RESET_ALL)
74
+ if re.search(r"[^a-zA-Z0-9._-]", args.username):
75
+ print(
76
+ Fore.RED + f"[!] Username '{args.username}' contains unsupported special characters. X (Twitter) doesn't support these." + Style.RESET_ALL)
74
77
  if (args.module == "bluesky" or args.category == "social"):
75
- if re.search(r"[^a-zA-Z0-9\.-]", args.username):
76
- print(Fore.RED + f"[!] Username '{args.username}' contains unsupported special characters. Bluesky will throw error. (Supported: only hyphens and digits)" + Style.RESET_ALL +"\n")
78
+ if re.search(r"[^a-zA-Z0-9\.-]", args.username):
79
+ print(
80
+ Fore.RED + f"[!] Username '{args.username}' contains unsupported special characters. Bluesky will throw error. (Supported: only hyphens and digits)" + Style.RESET_ALL + "\n")
77
81
  if not args.username:
78
- parser.print_help()
79
- return
82
+ parser.print_help()
83
+ return
80
84
  else:
81
- print_banner()
82
-
85
+ print_banner()
83
86
 
84
87
  from user_scanner import dev, social, creator, community, gaming, donation
85
88
 
@@ -96,7 +99,8 @@ def main():
96
99
  run_module_single(module, args.username)
97
100
  found = True
98
101
  if not found:
99
- print(Fore.RED + f"[!] Module '{args.module}' not found in any category." + Style.RESET_ALL)
102
+ print(
103
+ Fore.RED + f"[!] Module '{args.module}' not found in any category." + Style.RESET_ALL)
100
104
  elif args.category:
101
105
  # Category-wise scan
102
106
  category_package = eval(CATEGORY_MAPPING[args.category])
@@ -106,5 +110,6 @@ def main():
106
110
  # Full scan
107
111
  run_checks(args.username)
108
112
 
113
+
109
114
  if __name__ == "__main__":
110
115
  main()
@@ -23,10 +23,12 @@ INFO_BOX = f"""{C_MAGENTA} ╔═══════════════
23
23
  ║ {C_RED}♚ {C_GREEN}Email{C_WHITE} : kaifcodec@gmail.com {C_MAGENTA}║
24
24
  ══════════════════════════════════════════{Style.RESET_ALL}""".strip()
25
25
 
26
+
26
27
  def print_banner():
27
28
  print(BANNER_ASCII)
28
29
  print(INFO_BOX)
29
30
  print(" ")
30
31
 
32
+
31
33
  if __name__ == "__main__":
32
34
  print_banner()
@@ -1,18 +1,19 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
2
 
3
- def validate_coderlegion(user):
4
- url = f"https://coderlegion.com/user/{user}"
5
-
6
- return status_validate(url, 404, 200, timeout = 15.0)
7
3
 
8
- if __name__ == "__main__":
9
- user = input ("Username?: ").strip()
10
- result = validate_coderlegion(user)
4
+ def validate_coderlegion(user):
5
+ url = f"https://coderlegion.com/user/{user}"
6
+
7
+ return status_validate(url, 404, 200, timeout=15.0)
11
8
 
12
- if result == 1:
13
- print("Available!")
14
- elif result == 0:
15
- print("Unavailable!")
16
- else:
17
- print("Error occured!")
18
9
 
10
+ if __name__ == "__main__":
11
+ user = input("Username?: ").strip()
12
+ result = validate_coderlegion(user)
13
+
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ print("Error occured!")
@@ -7,9 +7,10 @@ import httpx
7
7
  from httpx import ConnectError, TimeoutException
8
8
 
9
9
  lock = threading.Condition()
10
- #Basically which thread is the one to print
10
+ # Basically which thread is the one to print
11
11
  print_queue = 0
12
12
 
13
+
13
14
  def load_modules(package):
14
15
 
15
16
  modules = []
@@ -21,12 +22,13 @@ def load_modules(package):
21
22
  print(f"Failed to import {name}: {e}")
22
23
  return modules
23
24
 
25
+
24
26
  def worker_single(module, username, i):
25
27
  global print_queue
26
28
 
27
29
  func = next((getattr(module, f) for f in dir(module)
28
30
  if f.startswith("validate_") and callable(getattr(module, f))), None)
29
- site_name = module.__name__.split('.')[-1].capitalize().replace("_",".")
31
+ site_name = module.__name__.split('.')[-1].capitalize().replace("_", ".")
30
32
  if site_name == "X":
31
33
  site_name = "X (Twitter)"
32
34
 
@@ -46,7 +48,7 @@ def worker_single(module, username, i):
46
48
  output = f" {Fore.YELLOW}[!] {site_name} has no validate_ function{Style.RESET_ALL}"
47
49
 
48
50
  with lock:
49
- #Waits for in-order printing
51
+ # Waits for in-order printing
50
52
  while i != print_queue:
51
53
  lock.wait()
52
54
 
@@ -54,13 +56,15 @@ def worker_single(module, username, i):
54
56
  print_queue += 1
55
57
  lock.notify_all()
56
58
 
59
+
57
60
  def run_module_single(module, username):
58
- #Just executes as if it was a thread
61
+ # Just executes as if it was a thread
59
62
  worker_single(module, username, print_queue)
60
-
63
+
64
+
61
65
  def run_checks_category(package, username, verbose=False):
62
66
  global print_queue
63
-
67
+
64
68
  modules = load_modules(package)
65
69
  category_name = package.__name__.split('.')[-1].capitalize()
66
70
  print(f"{Fore.MAGENTA}== {category_name} SITES =={Style.RESET_ALL}")
@@ -76,6 +80,7 @@ def run_checks_category(package, username, verbose=False):
76
80
  for t in threads:
77
81
  t.join()
78
82
 
83
+
79
84
  def run_checks(username):
80
85
  from user_scanner import dev, social, creator, community, gaming, donation
81
86
 
@@ -87,6 +92,7 @@ def run_checks(username):
87
92
  run_checks_category(package, username)
88
93
  print()
89
94
 
95
+
90
96
  def make_get_request(url, **kwargs):
91
97
  """Simple wrapper to **httpx.get** that predefines headers and timeout"""
92
98
  if not "headers" in kwargs:
@@ -103,6 +109,7 @@ def make_get_request(url, **kwargs):
103
109
 
104
110
  return httpx.get(url, **kwargs)
105
111
 
112
+
106
113
  def generic_validate(url, func, **kwargs):
107
114
  """
108
115
  A generic validate function that makes a request and executes the provided function on the response.
@@ -114,7 +121,8 @@ def generic_validate(url, func, **kwargs):
114
121
  return 2
115
122
  except Exception:
116
123
  return 2
117
-
124
+
125
+
118
126
  def status_validate(url, available, taken, **kwargs):
119
127
  """
120
128
  Function that takes a **url** and **kwargs** for the request and
@@ -122,15 +130,15 @@ def status_validate(url, available, taken, **kwargs):
122
130
  **Available** and **Taken** must either be whole numbers or lists of whole numbers.
123
131
  """
124
132
  def inner(response):
125
- #Checks if a number is equal or is contained inside
126
- contains = lambda a,b: (isinstance(a,list) and b in a) or (a == b)
133
+ # Checks if a number is equal or is contained inside
134
+ def contains(a, b): return (isinstance(a, list) and b in a) or (a == b)
127
135
 
128
136
  status = response.status_code
129
137
  available_value = contains(available, status)
130
138
  taken_value = contains(taken, status)
131
139
 
132
140
  if available_value and taken_value:
133
- return 2 # Can't be both available and taken
141
+ return 2 # Can't be both available and taken
134
142
  elif available_value:
135
143
  return 1
136
144
  elif taken_value:
@@ -1,17 +1,19 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_devto(user):
4
- url = f"https://dev.to/{user}"
5
+ url = f"https://dev.to/{user}"
6
+
7
+ return status_validate(url, 404, 200, follow_redirects=True)
5
8
 
6
- return status_validate(url, 404, 200, follow_redirects = True)
7
9
 
8
10
  if __name__ == "__main__":
9
- user = input ("Username?: ").strip()
10
- result = validate_devto(user)
11
+ user = input("Username?: ").strip()
12
+ result = validate_devto(user)
11
13
 
12
- if result == 1:
13
- print("Available!")
14
- elif result == 0:
15
- print("Unavailable!")
16
- else:
17
- print("Error occurred!")
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ print("Error occurred!")
@@ -2,20 +2,21 @@ import httpx
2
2
  import json
3
3
  from httpx import ConnectError, TimeoutException
4
4
 
5
+
5
6
  def validate_hashnode(user):
6
7
  url = "https://hashnode.com/utility/ajax/check-username"
7
8
 
8
9
  payload = {
9
- "username": user,
10
- "name": "Dummy Dummy"
10
+ "username": user,
11
+ "name": "Dummy Dummy"
11
12
  }
12
13
 
13
14
  headers = {
14
- 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
15
- 'Accept': "application/json",
16
- 'Content-Type': "application/json",
17
- 'Origin': "https://hashnode.com",
18
- 'Referer': "https://hashnode.com/signup",
15
+ 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
16
+ 'Accept': "application/json",
17
+ 'Content-Type': "application/json",
18
+ 'Origin': "https://hashnode.com",
19
+ 'Referer': "https://hashnode.com/signup",
19
20
  }
20
21
 
21
22
  try:
@@ -33,7 +34,7 @@ def validate_hashnode(user):
33
34
  return 2
34
35
 
35
36
  else:
36
- return 2
37
+ return 2
37
38
 
38
39
  except (ConnectError, TimeoutException):
39
40
  return 2
@@ -42,13 +43,14 @@ def validate_hashnode(user):
42
43
  except Exception:
43
44
  return 2
44
45
 
46
+
45
47
  if __name__ == "__main__":
46
- user = input ("Username?: ").strip()
47
- result = validate_hashnode(user)
48
-
49
- if result == 1:
50
- print("Available!")
51
- elif result == 0:
52
- print("Unavailable!")
53
- else:
54
- print("Error occurred!")
48
+ user = input("Username?: ").strip()
49
+ result = validate_hashnode(user)
50
+
51
+ if result == 1:
52
+ print("Available!")
53
+ elif result == 0:
54
+ print("Unavailable!")
55
+ else:
56
+ print("Error occurred!")
@@ -1,4 +1,5 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_itch_io(user):
4
5
  """
@@ -8,15 +9,16 @@ def validate_itch_io(user):
8
9
 
9
10
  url = f"https://{user}.itch.io"
10
11
 
11
- return status_validate(url, 404, 200, follow_redirects = True)
12
+ return status_validate(url, 404, 200, follow_redirects=True)
13
+
12
14
 
13
15
  if __name__ == "__main__":
14
- user = input ("Username?: ").strip()
15
- result = validate_itch_io(user)
16
+ user = input("Username?: ").strip()
17
+ result = validate_itch_io(user)
16
18
 
17
- if result == 1:
18
- print("Available!")
19
- elif result == 0:
20
- print("Unavailable!")
21
- else:
22
- print("Error occurred!")
19
+ if result == 1:
20
+ print("Available!")
21
+ elif result == 0:
22
+ print("Unavailable!")
23
+ else:
24
+ print("Error occurred!")
@@ -1,18 +1,19 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_kaggle(user):
4
- url = f"https://www.kaggle.com/{user}"
5
+ url = f"https://www.kaggle.com/{user}"
5
6
 
6
- return status_validate(url, 404, 200, follow_redirects=True)
7
+ return status_validate(url, 404, 200, follow_redirects=True)
7
8
 
8
9
 
9
10
  if __name__ == "__main__":
10
- user = input ("Username?: ").strip()
11
- result = validate_kaggle(user)
11
+ user = input("Username?: ").strip()
12
+ result = validate_kaggle(user)
12
13
 
13
- if result == 1:
14
- print("Available!")
15
- elif result == 0:
16
- print("Unavailable!")
17
- else:
18
- print("Error occurred!")
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ print("Error occurred!")
@@ -1,6 +1,7 @@
1
1
  import httpx
2
2
  from httpx import ConnectError, TimeoutException
3
3
 
4
+
4
5
  def validate_medium(user):
5
6
  url = f"https://medium.com/@{user}"
6
7
 
@@ -15,7 +16,6 @@ def validate_medium(user):
15
16
  if response.status_code == 200:
16
17
  html_text = response.text
17
18
 
18
-
19
19
  username_tag = f'property="profile:username" content="{user}"'
20
20
 
21
21
  if username_tag in html_text:
@@ -29,13 +29,14 @@ def validate_medium(user):
29
29
  except Exception:
30
30
  return 2
31
31
 
32
+
32
33
  if __name__ == "__main__":
33
- user = input ("Username?: ").strip()
34
- result = validate_medium(user)
35
-
36
- if result == 1:
37
- print("Available!")
38
- elif result == 0:
39
- print("Unavailable!")
40
- else:
41
- print("Error occurred!")
34
+ user = input("Username?: ").strip()
35
+ result = validate_medium(user)
36
+
37
+ if result == 1:
38
+ print("Available!")
39
+ elif result == 0:
40
+ print("Unavailable!")
41
+ else:
42
+ print("Error occurred!")
@@ -1,23 +1,25 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_patreon(user):
4
5
  url = f"https://www.patreon.com/{user}"
5
6
 
6
- return status_validate(url, 404, 200, timeout = 15.0, follow_redirects=True)
7
+ return status_validate(url, 404, 200, timeout=15.0, follow_redirects=True)
8
+
7
9
 
8
10
  if __name__ == "__main__":
9
- try:
10
- import httpx
11
- except ImportError:
12
- print("Error: 'httpx' library is not installed.")
13
- exit()
11
+ try:
12
+ import httpx
13
+ except ImportError:
14
+ print("Error: 'httpx' library is not installed.")
15
+ exit()
14
16
 
15
- user = input ("Username?: ").strip()
16
- result = validate_patreon(user)
17
+ user = input("Username?: ").strip()
18
+ result = validate_patreon(user)
17
19
 
18
- if result == 1:
19
- print("Available!")
20
- elif result == 0:
21
- print("Unavailable!")
22
- else:
23
- print("Error occured!")
20
+ if result == 1:
21
+ print("Available!")
22
+ elif result == 0:
23
+ print("Unavailable!")
24
+ else:
25
+ print("Error occured!")
@@ -1,6 +1,7 @@
1
1
  import httpx
2
2
  from httpx import ConnectError, TimeoutException
3
3
 
4
+
4
5
  def validate_producthunt(user):
5
6
  url = f"https://www.producthunt.com/@{user}"
6
7
 
@@ -12,29 +13,30 @@ def validate_producthunt(user):
12
13
  }
13
14
 
14
15
  try:
15
- response = httpx.get(url, headers=headers, timeout = 3.0, follow_redirects=True)
16
+ response = httpx.get(url, headers=headers,
17
+ timeout=3.0, follow_redirects=True)
16
18
  status = response.status_code
17
19
 
18
20
  if status == 200:
19
- return 0
21
+ return 0
20
22
  elif status == 404:
21
- return 1
23
+ return 1
22
24
  else:
23
- return 2
25
+ return 2
24
26
 
25
27
  except (ConnectError, TimeoutException):
26
28
  return 2
27
29
  except Exception:
28
30
  return 2
29
31
 
30
- if __name__ == "__main__":
31
- user = input ("Username?: ").strip()
32
- result = validate_producthunt(user)
33
-
34
- if result == 1:
35
- print("Available!")
36
- elif result == 0:
37
- print("Unavailable!")
38
- else:
39
- print("Error occured!")
40
32
 
33
+ if __name__ == "__main__":
34
+ user = input("Username?: ").strip()
35
+ result = validate_producthunt(user)
36
+
37
+ if result == 1:
38
+ print("Available!")
39
+ elif result == 0:
40
+ print("Unavailable!")
41
+ else:
42
+ print("Error occured!")
@@ -1,17 +1,19 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_codeberg(user):
4
- url = f"https://codeberg.org/{user}"
5
+ url = f"https://codeberg.org/{user}"
6
+
7
+ return status_validate(url, 404, 200, follow_redirects=True)
5
8
 
6
- return status_validate(url, 404, 200, follow_redirects = True)
7
9
 
8
10
  if __name__ == "__main__":
9
- user = input ("Username?: ").strip()
10
- result = validate_codeberg(user)
11
+ user = input("Username?: ").strip()
12
+ result = validate_codeberg(user)
11
13
 
12
- if result == 1:
13
- print("Available!")
14
- elif result == 0:
15
- print("Unavailable!")
16
- else:
17
- print("Error occurred!")
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ print("Error occurred!")
@@ -1,24 +1,26 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_cratesio(user):
4
- url = f"https://crates.io/api/v1/users/{user}"
5
+ url = f"https://crates.io/api/v1/users/{user}"
6
+
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': "application/json",
10
+ 'Referer': "https://crates.io/",
11
+ 'sec-fetch-mode': "cors",
12
+ }
5
13
 
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': "application/json",
9
- 'Referer': "https://crates.io/",
10
- 'sec-fetch-mode': "cors",
11
- }
14
+ return status_validate(url, 404, 200, headers=headers)
12
15
 
13
- return status_validate(url, 404, 200, headers = headers)
14
16
 
15
17
  if __name__ == "__main__":
16
- user = input ("Username?: ").strip()
17
- result = validate_cratesio(user)
18
+ user = input("Username?: ").strip()
19
+ result = validate_cratesio(user)
18
20
 
19
- if result == 1:
20
- print("Available!")
21
- elif result == 0:
22
- print("Unavailable!")
23
- else:
24
- print("Error occurred!")
21
+ if result == 1:
22
+ print("Available!")
23
+ elif result == 0:
24
+ print("Unavailable!")
25
+ else:
26
+ print("Error occurred!")
@@ -1,22 +1,24 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_dockerhub(user):
4
- url = f"https://hub.docker.com/v2/users/{user}/"
5
+ url = f"https://hub.docker.com/v2/users/{user}/"
6
+
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': "application/json",
10
+ }
5
11
 
6
- headers = {
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",
9
- }
12
+ return status_validate(url, 404, 200, headers=headers)
10
13
 
11
- return status_validate(url, 404, 200, headers = headers)
12
14
 
13
15
  if __name__ == "__main__":
14
- user = input ("Username?: ").strip()
15
- result = validate_dockerhub(user)
16
+ user = input("Username?: ").strip()
17
+ result = validate_dockerhub(user)
16
18
 
17
- if result == 1:
18
- print("Available!")
19
- elif result == 0:
20
- print("Unavailable!")
21
- else:
22
- print("Error occurred!")
19
+ if result == 1:
20
+ print("Available!")
21
+ elif result == 0:
22
+ print("Unavailable!")
23
+ else:
24
+ print("Error occurred!")