user-scanner 1.0.1.0__py3-none-any.whl → 1.0.1.2__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.
@@ -0,0 +1,44 @@
1
+ import httpx
2
+ from httpx import ConnectError, TimeoutException
3
+
4
+ def validate_osu(user):
5
+ """
6
+ Checks if a Osu username is available.
7
+ Returns: 1 -> available, 0 -> taken, 2 -> error
8
+ """
9
+
10
+ url = f"https://osu.ppy.sh/users/{user}"
11
+
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
34
+
35
+ if __name__ == "__main__":
36
+ user = input ("Username?: ").strip()
37
+ result = validate_osu(user)
38
+
39
+ if result == 1:
40
+ print("Available!")
41
+ elif result == 0:
42
+ print("Unavailable!")
43
+ else:
44
+ print("Error occurred!")
@@ -0,0 +1,47 @@
1
+ import httpx
2
+ from httpx import ConnectError, TimeoutException
3
+
4
+ def validate_roblox(user):
5
+ """
6
+ Checks if a roblox username is available.
7
+ Returns: 1 -> available, 0 -> taken, 2 -> error
8
+ """
9
+
10
+ url = f"https://users.roblox.com/v1/users/search?keyword={user}&limit=10" # official api
11
+
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
23
+ search_results = response.json() # api response
24
+
25
+ if "errors" in search_results: # this usually triggers when timeout or ratelimit
26
+ return 2
27
+
28
+ 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
30
+ return 0
31
+ return 1
32
+
33
+ except (ConnectError, TimeoutException):
34
+ return 2
35
+ except Exception as e:
36
+ return 2
37
+
38
+ if __name__ == "__main__":
39
+ user = input ("Username?: ").strip()
40
+ result = validate_roblox(user)
41
+
42
+ if result == 1:
43
+ print("Available!")
44
+ elif result == 0:
45
+ print("Unavailable!")
46
+ else:
47
+ print("Error occurred!")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: user-scanner
3
- Version: 1.0.1.0
3
+ Version: 1.0.1.2
4
4
  Summary: Check username availability across multiple popular platforms
5
5
  Keywords: username,checker,availability,social,tech,python,user-scanner
6
6
  Author-email: Kaif <kafcodec@gmail.com>
@@ -21,6 +21,8 @@ user_scanner/dev/npmjs.py,sha256=Tv2YgCpuSxJKWEPdcTWwm9CCl2rmfKlGdQe2rnMnXM8,114
21
21
  user_scanner/dev/replit.py,sha256=GN1Q8PecTzBsd6TpOT-qRnMvKhFTh1P6uCa8CDlXkpw,925
22
22
  user_scanner/gaming/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  user_scanner/gaming/chess_com.py,sha256=f634Js-KvBVpQC2AOi5TpIR9S5ttxjnAhI6eQtoYtXw,1514
24
+ user_scanner/gaming/osu.py,sha256=Jz_s6qNURC-L10-MSfTh6mEywoEqOh8Stvb_bWJR_0I,1239
25
+ user_scanner/gaming/roblox.py,sha256=1Chdg5f4C5uWuCcYM6JGt7kxYCRHC8E5OkTgHwFKXC4,1528
24
26
  user_scanner/social/__init__.py,sha256=jaCkFwX1uYtF0ENifVwF8OfHrYYUTm64B9wlBq9BBfQ,9
25
27
  user_scanner/social/bluesky.py,sha256=r5UIFCStlwEM4UxE6cDTrDb5w_EqPCgJ2iYz27GpjA8,2157
26
28
  user_scanner/social/instagram.py,sha256=oskZgHagkyl_p-bi7CMYqCh0wsoqfCFnR7GZcbKX1-U,1229
@@ -32,8 +34,8 @@ user_scanner/social/telegram.py,sha256=QxK2jD2QEvrYmnkxysl_yk7-G6CRWvkK5EnK6n5q3
32
34
  user_scanner/social/threads.py,sha256=QRidTYquAMDHJSg68ySpWCbliRYdWJkbOqn8RfWzFQQ,1231
33
35
  user_scanner/social/x.py,sha256=NetPGmPnWEKv6za9E_Ekah9bAeeFlEeY3qbTJQo7AqE,1560
34
36
  user_scanner/social/youtube.py,sha256=zuyWCy5FtEilaIcUZ4dTCctRR9deFnwwWJkf-h_1K0E,1943
35
- user_scanner-1.0.1.0.dist-info/entry_points.txt,sha256=XqU3kssYZ0vXaPy5qYUOTCu4u-48Xie7QWFpBCYc7Nc,59
36
- user_scanner-1.0.1.0.dist-info/licenses/LICENSE,sha256=XH1QyQG68zo1opDIZHTHcTAbe9XMzewvTaFTukcN9vc,1061
37
- user_scanner-1.0.1.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
38
- user_scanner-1.0.1.0.dist-info/METADATA,sha256=nkhFq9xywhrK-yML33Yfcwm_J3v-L7j7wAUpxxUlBJU,2363
39
- user_scanner-1.0.1.0.dist-info/RECORD,,
37
+ user_scanner-1.0.1.2.dist-info/entry_points.txt,sha256=XqU3kssYZ0vXaPy5qYUOTCu4u-48Xie7QWFpBCYc7Nc,59
38
+ user_scanner-1.0.1.2.dist-info/licenses/LICENSE,sha256=XH1QyQG68zo1opDIZHTHcTAbe9XMzewvTaFTukcN9vc,1061
39
+ user_scanner-1.0.1.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
40
+ user_scanner-1.0.1.2.dist-info/METADATA,sha256=G13us1fQQEU1j1CV3lFLhfb6tWyHa2ebtnxCqlBNyns,2363
41
+ user_scanner-1.0.1.2.dist-info/RECORD,,