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
@@ -1,31 +1,33 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import status_validate
2
+
2
3
 
3
4
  def validate_github(user):
4
- url = f"https://github.com/signup_check/username?value={user}"
5
+ url = f"https://github.com/signup_check/username?value={user}"
6
+
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
+ }
5
20
 
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
- }
21
+ return status_validate(url, 200, 422, headers=headers)
19
22
 
20
- return status_validate(url, 200, 422, headers = headers)
21
23
 
22
24
  if __name__ == "__main__":
23
- user = input ("Username?: ").strip()
24
- result = validate_github(user)
25
+ user = input("Username?: ").strip()
26
+ result = validate_github(user)
25
27
 
26
- if result == 1:
27
- print("Available!")
28
- elif result == 0:
29
- print("Unavailable!")
30
- else:
31
- print("Error occured!")
28
+ if result == 1:
29
+ print("Available!")
30
+ elif result == 0:
31
+ print("Unavailable!")
32
+ else:
33
+ print("Error occured!")
@@ -1,4 +1,5 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+
2
3
 
3
4
  def validate_gitlab(user):
4
5
  url = f"https://gitlab.com/users/{user}/exists"
@@ -22,16 +23,17 @@ def validate_gitlab(user):
22
23
  elif data['exists'] is True:
23
24
  return 0
24
25
  return 2
25
-
26
- return generic_validate(url, process, headers = headers)
26
+
27
+ return generic_validate(url, process, headers=headers)
28
+
27
29
 
28
30
  if __name__ == "__main__":
29
- user = input ("Username?: ").strip()
30
- result = validate_gitlab(user)
31
-
32
- if result == 1:
33
- print("Available!")
34
- elif result == 0:
35
- print("Unavailable!")
36
- else:
37
- print("Error occurred!")
31
+ user = input("Username?: ").strip()
32
+ result = validate_gitlab(user)
33
+
34
+ if result == 1:
35
+ print("Available!")
36
+ elif result == 0:
37
+ print("Unavailable!")
38
+ else:
39
+ 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_launchpad(user):
4
- url = f"https://launchpad.net/~{user}"
5
+ url = f"https://launchpad.net/~{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': "text/html,application/xhtml+xml,application/xml;q=0.9",
10
+ 'Accept-Encoding': "gzip, deflate, br, zstd",
11
+ 'Upgrade-Insecure-Requests': "1",
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': "text/html,application/xhtml+xml,application/xml;q=0.9",
9
- 'Accept-Encoding': "gzip, deflate, br, zstd",
10
- 'Upgrade-Insecure-Requests': "1",
11
- }
14
+ return status_validate(url, 404, 200, headers=headers, follow_redirects=True)
12
15
 
13
- return status_validate(url, 404, 200, headers = headers, follow_redirects=True)
14
16
 
15
17
  if __name__ == "__main__":
16
- user = input ("Username?: ").strip()
17
- result = validate_launchpad(user)
18
+ user = input("Username?: ").strip()
19
+ result = validate_launchpad(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!")
user_scanner/dev/npmjs.py CHANGED
@@ -1,40 +1,43 @@
1
1
  import httpx
2
2
  from httpx import ConnectError, TimeoutException
3
3
 
4
+
4
5
  def validate_npmjs(user):
5
6
  url = f"https://www.npmjs.com/~{user}"
6
7
 
7
8
  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,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
10
- 'Accept-Encoding': "gzip, deflate, br, zstd",
11
- 'accept-language': "en-US,en;q=0.9",
12
- 'priority': "u=0, i"
13
- }
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': "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",
11
+ 'Accept-Encoding': "gzip, deflate, br, zstd",
12
+ 'accept-language': "en-US,en;q=0.9",
13
+ 'priority': "u=0, i"
14
+ }
14
15
 
15
16
  try:
16
- response = httpx.head(url, headers=headers, timeout=3.0, follow_redirects=True)
17
+ response = httpx.head(url, headers=headers,
18
+ timeout=3.0, follow_redirects=True)
17
19
  status = response.status_code
18
20
 
19
21
  if status == 200:
20
- return 0
22
+ return 0
21
23
  elif status == 404:
22
- return 1
24
+ return 1
23
25
  else:
24
- return 2
26
+ return 2
25
27
 
26
28
  except (ConnectError, TimeoutException):
27
29
  return 2
28
30
  except Exception:
29
31
  return 2
30
32
 
33
+
31
34
  if __name__ == "__main__":
32
- user = input ("Username?: ").strip()
33
- result = validate_npmjs(user)
34
-
35
- if result == 1:
36
- print("Available!")
37
- elif result == 0:
38
- print("Unavailable!")
39
- else:
40
- print("Error occurred!")
35
+ user = input("Username?: ").strip()
36
+ result = validate_npmjs(user)
37
+
38
+ if result == 1:
39
+ print("Available!")
40
+ elif result == 0:
41
+ print("Unavailable!")
42
+ else:
43
+ print("Error occurred!")
@@ -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_replit(user):
4
- url = f"https://replit.com/@{user}"
5
+ url = f"https://replit.com/@{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_replit(user)
11
+ user = input("Username?: ").strip()
12
+ result = validate_replit(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,21 +1,22 @@
1
1
  import httpx
2
2
  from httpx import ConnectError, TimeoutException
3
3
 
4
- from ..core.orchestrator import status_validate
4
+ from user_scanner.core.orchestrator import status_validate
5
+
5
6
 
6
7
  def validate_buymeacoffee(user):
7
8
  url = f"https://buymeacoffee.com/{user}"
8
9
 
9
- return status_validate(url, 404, 200, follow_redirects = True)
10
+ return status_validate(url, 404, 200, follow_redirects=True)
10
11
 
11
12
 
12
13
  if __name__ == "__main__":
13
- user = input ("Username?: ").strip()
14
- result = validate_buymeacoffee(user)
14
+ user = input("Username?: ").strip()
15
+ result = validate_buymeacoffee(user)
15
16
 
16
- if result == 1:
17
- print("Available!")
18
- elif result == 0:
19
- print("Unavailable!")
20
- else:
21
- print("Error occurred!")
17
+ if result == 1:
18
+ print("Available!")
19
+ elif result == 0:
20
+ print("Unavailable!")
21
+ else:
22
+ print("Error occurred!")
@@ -0,0 +1,36 @@
1
+ from user_scanner.core.orchestrator import status_validate
2
+
3
+
4
+ def validate_liberapay(user):
5
+ url = f"https://en.liberapay.com/{user}"
6
+
7
+ headers = {
8
+ "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
9
+ "accept-language": "en-Us,pt;q=0.6",
10
+ "cache-control": "no-cache",
11
+ "pragma": "no-cache",
12
+ "priority": "u=0, i",
13
+ "sec-ch-ua": '"Chromium";v="142", "Brave";v="142", "Not_A Brand";v="99"',
14
+ "sec-ch-ua-mobile": "?0",
15
+ "sec-ch-ua-platform": '"Windows"',
16
+ "sec-fetch-dest": "document",
17
+ "sec-fetch-mode": "navigate",
18
+ "sec-fetch-site": "none",
19
+ "sec-fetch-user": "?1",
20
+ "sec-gpc": "1",
21
+ "upgrade-insecure-requests": "1",
22
+ }
23
+
24
+ return status_validate(url, 404, 200, headers=headers, follow_redirects=True)
25
+
26
+
27
+ if __name__ == "__main__":
28
+ user = input("Username?: ").strip()
29
+ result = validate_liberapay(user)
30
+
31
+ if result == 1:
32
+ print("Available!")
33
+ elif result == 0:
34
+ print("Unavailable!")
35
+ else:
36
+ print("Error occurred!")
@@ -1,4 +1,5 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+
2
3
 
3
4
  def validate_chess_com(user):
4
5
  url = f"https://www.chess.com/callback/user/valid?username={user}"
@@ -15,27 +16,28 @@ def validate_chess_com(user):
15
16
  data = response.json()
16
17
  if data.get('valid') is True:
17
18
  # 'valid': true means the username is NOT taken
18
- return 1
19
+ return 1
19
20
  elif data.get('valid') is False:
20
21
  # 'valid': false means the username IS taken
21
22
  return 0
22
23
  return 2
23
24
 
24
- return generic_validate(url, process, headers = headers)
25
+ return generic_validate(url, process, headers=headers)
26
+
25
27
 
26
28
  if __name__ == "__main__":
27
- try:
28
- import httpx
29
- except ImportError:
30
- print("Error: 'httpx' library is not installed.")
31
- exit()
32
-
33
- user = input ("Username?: ").strip()
34
- result = validate_chess_com(user)
35
-
36
- if result == 1:
37
- print("Available!")
38
- elif result == 0:
39
- print("Unavailable!")
40
- else:
41
- print("Error occured!")
29
+ try:
30
+ import httpx
31
+ except ImportError:
32
+ print("Error: 'httpx' library is not installed.")
33
+ exit()
34
+
35
+ user = input("Username?: ").strip()
36
+ result = validate_chess_com(user)
37
+
38
+ if result == 1:
39
+ print("Available!")
40
+ elif result == 0:
41
+ print("Unavailable!")
42
+ else:
43
+ print("Error occured!")
@@ -0,0 +1,24 @@
1
+ from user_scanner.core.orchestrator import status_validate
2
+
3
+
4
+ def validate_minecraft(user):
5
+ """
6
+ Checks for minecraft username with mojang api.
7
+ Returns: 1 -> available, 0 -> taken, 2 -> error
8
+ """
9
+
10
+ url = f"https://api.mojang.com/minecraft/profile/lookup/name/{user}"
11
+
12
+ return status_validate(url, 404, 200, follow_redirects=True)
13
+
14
+
15
+ if __name__ == "__main__":
16
+ user = input("Username?: ").strip()
17
+ result = validate_minecraft(user)
18
+
19
+ if result == 1:
20
+ print("Available!")
21
+ elif result == 0:
22
+ print("Unavailable!")
23
+ else:
24
+ print("Error occurred!")
@@ -1,4 +1,5 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+
2
3
 
3
4
  def validate_monkeytype(user: str) -> int:
4
5
 
@@ -28,9 +29,9 @@ def validate_monkeytype(user: str) -> int:
28
29
  elif available is False:
29
30
  return 0
30
31
  return 2
31
-
32
32
 
33
- return generic_validate(url, process, headers = headers)
33
+ return generic_validate(url, process, headers=headers)
34
+
34
35
 
35
36
  if __name__ == "__main__":
36
37
  try:
@@ -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_osu(user):
4
5
  """
5
6
  Checks if a Osu username is available.
6
7
  Returns: 1 -> available, 0 -> taken, 2 -> error
7
8
  """
8
-
9
+
9
10
  url = f"https://osu.ppy.sh/users/{user}"
10
-
11
- return status_validate(url, 404, [200, 302], follow_redirects = True)
11
+
12
+ return status_validate(url, 404, [200, 302], follow_redirects=True)
13
+
12
14
 
13
15
  if __name__ == "__main__":
14
- user = input ("Username?: ").strip()
15
- result = validate_osu(user)
16
+ user = input("Username?: ").strip()
17
+ result = validate_osu(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,4 +1,5 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+
2
3
 
3
4
  def validate_roblox(user):
4
5
  """
@@ -6,29 +7,32 @@ def validate_roblox(user):
6
7
  Returns: 1 -> available, 0 -> taken, 2 -> error
7
8
  """
8
9
 
9
- url = f"https://users.roblox.com/v1/users/search?keyword={user}&limit=10" # official api
10
+ # official api
11
+ url = f"https://users.roblox.com/v1/users/search?keyword={user}&limit=10"
10
12
 
11
13
  def process(response):
12
- search_results = response.json() # api response
14
+ search_results = response.json() # api response
13
15
 
14
- if "errors" in search_results: # this usually triggers when timeout or ratelimit
16
+ if "errors" in search_results: # this usually triggers when timeout or ratelimit
15
17
  return 2
16
18
 
17
- for entry in search_results["data"]: # iterates through the entries in the search results
19
+ # iterates through the entries in the search results
20
+ for entry in search_results["data"]:
18
21
  # .lower() so casing from the API doesn't matter
19
- if entry["name"].lower() == user.lower(): # if a username matches the user
22
+ if entry["name"].lower() == user.lower(): # if a username matches the user
20
23
  return 0
21
24
  return 1
22
25
 
23
- return generic_validate(url, process, follow_redirects = True)
26
+ return generic_validate(url, process, follow_redirects=True)
27
+
24
28
 
25
29
  if __name__ == "__main__":
26
- user = input ("Username?: ").strip()
27
- result = validate_roblox(user)
28
-
29
- if result == 1:
30
- print("Available!")
31
- elif result == 0:
32
- print("Unavailable!")
33
- else:
34
- print("Error occurred!")
30
+ user = input("Username?: ").strip()
31
+ result = validate_roblox(user)
32
+
33
+ if result == 1:
34
+ print("Available!")
35
+ elif result == 0:
36
+ print("Unavailable!")
37
+ else:
38
+ print("Error occurred!")
@@ -1,4 +1,5 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+
2
3
 
3
4
  def validate_steam(user):
4
5
  """
@@ -18,13 +19,14 @@ def validate_steam(user):
18
19
 
19
20
  return generic_validate(url, process)
20
21
 
22
+
21
23
  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!")
24
+ user = input("Username?: ").strip()
25
+ result = validate_steam(user)
26
+
27
+ if result == 1:
28
+ print("Available!")
29
+ elif result == 0:
30
+ print("Unavailable!")
31
+ else:
32
+ print("Error occurred!")
@@ -1,5 +1,6 @@
1
1
  import re
2
- from ..core.orchestrator import generic_validate
2
+ from user_scanner.core.orchestrator import generic_validate
3
+
3
4
 
4
5
  def validate_bluesky(user):
5
6
  handle = user if user.endswith('.bsky.social') else f"{user}.bsky.social"
@@ -26,7 +27,7 @@ def validate_bluesky(user):
26
27
 
27
28
  if not re.fullmatch(r"^[a-zA-Z0-9\.-]{1,64}$", user):
28
29
  return 2
29
-
30
+
30
31
  def process(response):
31
32
  if response.status_code == 200:
32
33
  data = response.json()
@@ -38,21 +39,22 @@ def validate_bluesky(user):
38
39
  return 0
39
40
  return 2
40
41
 
41
- return generic_validate(url, process, headers = headers, params = params, timeout = 15.0)
42
+ return generic_validate(url, process, headers=headers, params=params, timeout=15.0)
43
+
42
44
 
43
45
  if __name__ == "__main__":
44
- try:
45
- import httpx
46
- except ImportError:
47
- print("Error: 'httpx' library is not installed.")
48
- exit()
49
-
50
- user = input ("Username?: ").strip()
51
- result = validate_bluesky(user)
52
-
53
- if result == 1:
54
- print("Available!")
55
- elif result == 0:
56
- print("Unavailable!")
57
- else:
58
- print("Error occured!")
46
+ try:
47
+ import httpx
48
+ except ImportError:
49
+ print("Error: 'httpx' library is not installed.")
50
+ exit()
51
+
52
+ user = input("Username?: ").strip()
53
+ result = validate_bluesky(user)
54
+
55
+ if result == 1:
56
+ print("Available!")
57
+ elif result == 0:
58
+ print("Unavailable!")
59
+ else:
60
+ 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_discord(user):
5
6
  url = "https://discord.com/api/v9/unique-username/username-attempt-unauthed"
6
7
 
@@ -12,9 +13,9 @@ def validate_discord(user):
12
13
  "origin": "https://discord.com",
13
14
  "referer": "https://discord.com/register"
14
15
  }
15
-
16
+
16
17
  data = {"username": user}
17
-
18
+
18
19
  try:
19
20
  response = httpx.post(url, headers=headers, json=data, timeout=3.0)
20
21
  if response.status_code == 200:
@@ -29,16 +30,14 @@ def validate_discord(user):
29
30
  except Exception:
30
31
  return 2
31
32
 
32
- if __name__ == "__main__":
33
- user = input ("Username?: ").strip()
34
- result = validate_discord(user)
35
-
36
- if result == 1:
37
- print("Available!")
38
- elif result == 0:
39
- print("Unavailable!")
40
- else:
41
- print("Error occured!")
42
-
43
33
 
34
+ if __name__ == "__main__":
35
+ user = input("Username?: ").strip()
36
+ result = validate_discord(user)
44
37
 
38
+ if result == 1:
39
+ print("Available!")
40
+ elif result == 0:
41
+ print("Unavailable!")
42
+ else:
43
+ print("Error occured!")