user-scanner 1.0.5.0__py3-none-any.whl → 1.0.9.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 (55) hide show
  1. user_scanner/__init__.py +0 -1
  2. user_scanner/__main__.py +113 -64
  3. user_scanner/cli/banner.py +2 -0
  4. user_scanner/cli/printer.py +117 -0
  5. user_scanner/community/__init__.py +1 -0
  6. user_scanner/community/coderlegion.py +15 -14
  7. user_scanner/community/stackoverflow.py +35 -0
  8. user_scanner/core/orchestrator.py +167 -95
  9. user_scanner/core/result.py +128 -0
  10. user_scanner/core/utils.py +9 -0
  11. user_scanner/creator/devto.py +13 -11
  12. user_scanner/creator/hashnode.py +25 -28
  13. user_scanner/creator/itch_io.py +12 -15
  14. user_scanner/creator/kaggle.py +12 -11
  15. user_scanner/creator/medium.py +18 -22
  16. user_scanner/creator/patreon.py +12 -16
  17. user_scanner/creator/producthunt.py +38 -31
  18. user_scanner/dev/codeberg.py +13 -11
  19. user_scanner/dev/cratesio.py +19 -17
  20. user_scanner/dev/dockerhub.py +17 -15
  21. user_scanner/dev/github.py +46 -27
  22. user_scanner/dev/gitlab.py +18 -15
  23. user_scanner/dev/huggingface.py +19 -0
  24. user_scanner/dev/launchpad.py +19 -17
  25. user_scanner/dev/npmjs.py +21 -34
  26. user_scanner/dev/replit.py +13 -11
  27. user_scanner/donation/buymeacoffee.py +10 -12
  28. user_scanner/donation/liberapay.py +36 -0
  29. user_scanner/gaming/chess_com.py +17 -20
  30. user_scanner/gaming/minecraft.py +19 -0
  31. user_scanner/gaming/monkeytype.py +7 -12
  32. user_scanner/gaming/osu.py +13 -16
  33. user_scanner/gaming/roblox.py +35 -26
  34. user_scanner/gaming/steam.py +18 -19
  35. user_scanner/social/bluesky.py +20 -24
  36. user_scanner/social/discord.py +17 -21
  37. user_scanner/social/instagram.py +22 -20
  38. user_scanner/social/mastodon.py +12 -16
  39. user_scanner/social/pinterest.py +15 -13
  40. user_scanner/social/reddit.py +16 -13
  41. user_scanner/social/snapchat.py +28 -26
  42. user_scanner/social/soundcloud.py +43 -0
  43. user_scanner/social/telegram.py +19 -17
  44. user_scanner/social/threads.py +23 -21
  45. user_scanner/social/x.py +20 -28
  46. user_scanner/social/youtube.py +41 -47
  47. user_scanner/utils/update.py +0 -0
  48. user_scanner/utils/version.py +2 -0
  49. user_scanner/version.json +1 -1
  50. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.9.0.dist-info}/METADATA +58 -23
  51. user_scanner-1.0.9.0.dist-info/RECORD +61 -0
  52. user_scanner-1.0.5.0.dist-info/RECORD +0 -52
  53. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.9.0.dist-info}/WHEEL +0 -0
  54. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.9.0.dist-info}/entry_points.txt +0 -0
  55. {user_scanner-1.0.5.0.dist-info → user_scanner-1.0.9.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,23 +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_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)
7
8
 
8
- if __name__ == "__main__":
9
- try:
10
- import httpx
11
- except ImportError:
12
- print("Error: 'httpx' library is not installed.")
13
- exit()
14
9
 
15
- user = input ("Username?: ").strip()
16
- result = validate_patreon(user)
10
+ if __name__ == "__main__":
11
+ user = input("Username?: ").strip()
12
+ result = validate_patreon(user)
17
13
 
18
- if result == 1:
19
- print("Available!")
20
- elif result == 0:
21
- print("Unavailable!")
22
- else:
23
- print("Error occured!")
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ print("Error occured!")
@@ -1,40 +1,47 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from user_scanner.core.orchestrator import status_validate, Result
3
2
 
4
- def validate_producthunt(user):
5
- url = f"https://www.producthunt.com/@{user}"
6
3
 
4
+ def validate_youtube(user) -> Result:
5
+ url = f"https://m.youtube.com/@{user}"
7
6
  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",
7
+ 'User-Agent': "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.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
- 'Accept-Encoding': "gzip, deflate, br",
11
- 'Accept-Language': "en-US,en;q=0.9",
9
+ 'Accept-Encoding': "identity",
10
+ 'sec-ch-dpr': "2.75",
11
+ 'sec-ch-viewport-width': "980",
12
+ 'sec-ch-ua': "\"Google Chrome\";v=\"143\", \"Chromium\";v=\"143\", \"Not A(Brand\";v=\"24\"",
13
+ 'sec-ch-ua-mobile': "?1",
14
+ 'sec-ch-ua-full-version': "\"143.0.7499.52\"",
15
+ 'sec-ch-ua-arch': "\"\"",
16
+ 'sec-ch-ua-platform': "\"Android\"",
17
+ 'sec-ch-ua-platform-version': "\"15.0.0\"",
18
+ 'sec-ch-ua-bitness': "\"\"",
19
+ 'sec-ch-ua-wow64': "?0",
20
+ '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\"",
21
+ 'sec-ch-ua-form-factors': "\"Mobile\"",
22
+ 'upgrade-insecure-requests': "1",
23
+ 'x-browser-channel': "stable",
24
+ 'x-browser-year': "2025",
25
+ 'x-browser-copyright': "Copyright 2025 Google LLC. All Rights reserved.",
26
+ 'sec-fetch-site': "none",
27
+ 'sec-fetch-mode': "navigate",
28
+ 'sec-fetch-user': "?1",
29
+ 'sec-fetch-dest': "document",
30
+ 'accept-language': "en-US,en;q=0.9",
31
+ 'priority': "u=0, i"
12
32
  }
13
33
 
14
- try:
15
- response = httpx.get(url, headers=headers, timeout = 3.0, follow_redirects=True)
16
- status = response.status_code
34
+ return status_validate(url, 404, 200, headers=headers)
17
35
 
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
29
36
 
30
37
  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
-
38
+ user = input("Username?: ").strip()
39
+ result = validate_youtube(user)
40
+
41
+ if result == 1:
42
+ print("Available!")
43
+ elif result == 0:
44
+ print("Unavailable!")
45
+ else:
46
+ reason = result.get_reason()
47
+ print(f"Error occurred! Reason: {reason}")
@@ -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!")
@@ -1,31 +1,50 @@
1
- from ..core.orchestrator import status_validate
1
+ from user_scanner.core.orchestrator import generic_validate, Result
2
+
2
3
 
3
4
  def validate_github(user):
4
- url = f"https://github.com/signup_check/username?value={user}"
5
-
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
- }
19
-
20
- return status_validate(url, 200, 422, headers = headers)
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
+ }
20
+
21
+ GITHUB_INVALID_MSG = (
22
+ "Username may only contain alphanumeric characters or single hyphens, "
23
+ "and cannot begin or end with a hyphen."
24
+ )
25
+
26
+ def process(response):
27
+ if response.status_code == 200:
28
+ return Result.available()
29
+
30
+ if response.status_code == 422:
31
+ if GITHUB_INVALID_MSG in response.text:
32
+ return Result.error("Cannot start/end with hyphen or use double hyphens")
33
+
34
+ return Result.taken()
35
+
36
+ return Result.error("Unexpected GitHub response report it via issues")
37
+
38
+ return generic_validate(url, process, headers=headers)
39
+
21
40
 
22
41
  if __name__ == "__main__":
23
- user = input ("Username?: ").strip()
24
- result = validate_github(user)
25
-
26
- if result == 1:
27
- print("Available!")
28
- elif result == 0:
29
- print("Unavailable!")
30
- else:
31
- print("Error occured!")
42
+ user = input("Username?: ").strip()
43
+ result = validate_github(user)
44
+
45
+ if result == 1:
46
+ print("Available!")
47
+ elif result == 0:
48
+ print("Unavailable!")
49
+ else:
50
+ print("Error occured!")
@@ -1,4 +1,6 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+ from user_scanner.core.result import Result
3
+
2
4
 
3
5
  def validate_gitlab(user):
4
6
  url = f"https://gitlab.com/users/{user}/exists"
@@ -17,21 +19,22 @@ def validate_gitlab(user):
17
19
  # Corrected: Compare against Python boolean True/False
18
20
  # AVAILABLE (return 1) if "exists": true
19
21
  if data['exists'] is False:
20
- return 1
22
+ return Result.available()
21
23
  # UNAVAILABLE (return 0) if "exists": false
22
24
  elif data['exists'] is True:
23
- return 0
24
- return 2
25
-
26
- return generic_validate(url, process, headers = headers)
25
+ return Result.taken()
26
+ return Result.error("Invalid status code")
27
+
28
+ return generic_validate(url, process, headers=headers)
29
+
27
30
 
28
31
  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!")
32
+ user = input("Username?: ").strip()
33
+ result = validate_gitlab(user)
34
+
35
+ if result == 1:
36
+ print("Available!")
37
+ elif result == 0:
38
+ print("Unavailable!")
39
+ else:
40
+ print("Error occurred!")
@@ -0,0 +1,19 @@
1
+ from user_scanner.core.orchestrator import status_validate
2
+
3
+
4
+ def validate_huggingface(user):
5
+ url = f"https://huggingface.co/{user}"
6
+
7
+ return status_validate(url, 404, 200, follow_redirects=True)
8
+
9
+
10
+ if __name__ == "__main__":
11
+ user = input("Username?: ").strip()
12
+ result = validate_huggingface(user)
13
+
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_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,27 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ import re
2
+ from user_scanner.core.orchestrator import status_validate, Result
3
+
3
4
 
4
5
  def validate_npmjs(user):
6
+ if re.match(r'^[^a-zA-Z0-9_-]', user):
7
+ return Result.error("Username cannot start with a period")
8
+
9
+ if re.search(r'[A-Z]', user):
10
+ return Result.error("Username cannot contain uppercase letters.")
11
+
5
12
  url = f"https://www.npmjs.com/~{user}"
6
13
 
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,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
- }
14
-
15
- try:
16
- response = httpx.head(url, headers=headers, timeout=3.0, follow_redirects=True)
17
- status = response.status_code
18
-
19
- if status == 200:
20
- return 0
21
- elif status == 404:
22
- return 1
23
- else:
24
- return 2
25
-
26
- except (ConnectError, TimeoutException):
27
- return 2
28
- except Exception:
29
- return 2
14
+
15
+ return status_validate(url, 404, 200, timeout=3.0, follow_redirects=True)
16
+
30
17
 
31
18
  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!")
19
+ user = input("Username?: ").strip()
20
+ result = validate_npmjs(user)
21
+
22
+ if result == 1:
23
+ print("Available!")
24
+ elif result == 0:
25
+ print("Unavailable!")
26
+ else:
27
+ print(f"Error occurred! Reason: {result}")
@@ -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,19 @@
1
- import httpx
2
- from httpx import ConnectError, TimeoutException
1
+ from user_scanner.core.orchestrator import status_validate
3
2
 
4
- from ..core.orchestrator import status_validate
5
3
 
6
4
  def validate_buymeacoffee(user):
7
5
  url = f"https://buymeacoffee.com/{user}"
8
6
 
9
- return status_validate(url, 404, 200, follow_redirects = True)
7
+ return status_validate(url, 404, 200, follow_redirects=True)
10
8
 
11
9
 
12
10
  if __name__ == "__main__":
13
- user = input ("Username?: ").strip()
14
- result = validate_buymeacoffee(user)
11
+ user = input("Username?: ").strip()
12
+ result = validate_buymeacoffee(user)
15
13
 
16
- if result == 1:
17
- print("Available!")
18
- elif result == 0:
19
- print("Unavailable!")
20
- else:
21
- print("Error occurred!")
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ 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,6 @@
1
- from ..core.orchestrator import generic_validate
1
+ from user_scanner.core.orchestrator import generic_validate
2
+ from user_scanner.core.result import Result
3
+
2
4
 
3
5
  def validate_chess_com(user):
4
6
  url = f"https://www.chess.com/callback/user/valid?username={user}"
@@ -15,27 +17,22 @@ def validate_chess_com(user):
15
17
  data = response.json()
16
18
  if data.get('valid') is True:
17
19
  # 'valid': true means the username is NOT taken
18
- return 1
20
+ return Result.available()
19
21
  elif data.get('valid') is False:
20
22
  # 'valid': false means the username IS taken
21
- return 0
22
- return 2
23
+ return Result.taken()
24
+ return Result.error("Invalid status code")
25
+
26
+ return generic_validate(url, process, headers=headers)
23
27
 
24
- return generic_validate(url, process, headers = headers)
25
28
 
26
29
  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!")
30
+ user = input("Username?: ").strip()
31
+ result = validate_chess_com(user)
32
+
33
+ if result == 1:
34
+ print("Available!")
35
+ elif result == 0:
36
+ print("Unavailable!")
37
+ else:
38
+ print("Error occured!")
@@ -0,0 +1,19 @@
1
+ from user_scanner.core.orchestrator import status_validate
2
+
3
+
4
+ def validate_minecraft(user):
5
+ url = f"https://api.mojang.com/minecraft/profile/lookup/name/{user}"
6
+
7
+ return status_validate(url, 404, 200, follow_redirects=True)
8
+
9
+
10
+ if __name__ == "__main__":
11
+ user = input("Username?: ").strip()
12
+ result = validate_minecraft(user)
13
+
14
+ if result == 1:
15
+ print("Available!")
16
+ elif result == 0:
17
+ print("Unavailable!")
18
+ else:
19
+ print("Error occurred!")