user-scanner 1.0.0.9__py3-none-any.whl → 1.0.1.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.
- user_scanner/__main__.py +1 -1
- user_scanner/social/telegram.py +34 -0
- {user_scanner-1.0.0.9.dist-info → user_scanner-1.0.1.0.dist-info}/METADATA +1 -1
- {user_scanner-1.0.0.9.dist-info → user_scanner-1.0.1.0.dist-info}/RECORD +7 -6
- {user_scanner-1.0.0.9.dist-info → user_scanner-1.0.1.0.dist-info}/WHEEL +0 -0
- {user_scanner-1.0.0.9.dist-info → user_scanner-1.0.1.0.dist-info}/entry_points.txt +0 -0
- {user_scanner-1.0.0.9.dist-info → user_scanner-1.0.1.0.dist-info}/licenses/LICENSE +0 -0
user_scanner/__main__.py
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import httpx
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
def validate_telegram(user: str) -> int:
|
|
5
|
+
"""
|
|
6
|
+
Checks if a Telegram username is available.
|
|
7
|
+
Returns: 1 -> available, 0 -> taken, 2 -> error
|
|
8
|
+
"""
|
|
9
|
+
url = f"https://t.me/{user}"
|
|
10
|
+
headers = {
|
|
11
|
+
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
r = httpx.get(url, headers=headers, follow_redirects=True, timeout=3.0)
|
|
16
|
+
if r.status_code == 200:
|
|
17
|
+
return 0 if re.search(r'<div[^>]*class="tgme_page_extra"[^>]*>', r.text) else 1
|
|
18
|
+
return 2
|
|
19
|
+
except (httpx.ConnectError, httpx.TimeoutException):
|
|
20
|
+
return 2
|
|
21
|
+
except Exception:
|
|
22
|
+
return 2
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if __name__ == "__main__":
|
|
26
|
+
user = input ("Username?: ").strip()
|
|
27
|
+
result = validate_telegram(user)
|
|
28
|
+
|
|
29
|
+
if result == 1:
|
|
30
|
+
print("Available!")
|
|
31
|
+
elif result == 0:
|
|
32
|
+
print("Unavailable!")
|
|
33
|
+
else:
|
|
34
|
+
print("Error occured!")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: user-scanner
|
|
3
|
-
Version: 1.0.0
|
|
3
|
+
Version: 1.0.1.0
|
|
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>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
user_scanner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
user_scanner/__main__.py,sha256=
|
|
2
|
+
user_scanner/__main__.py,sha256=ihYZxGeiYebJLG72tegPQBYJtjn8CkKKzu87cSvKBVE,3653
|
|
3
3
|
user_scanner/community/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
user_scanner/community/coderlegion.py,sha256=wva0seSkd4h7kSjIprW0wM7JC0zspFjXGnDHkeIJ3YI,1141
|
|
5
5
|
user_scanner/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -28,11 +28,12 @@ user_scanner/social/mastodon.py,sha256=KbhdutPe_M0bvtkJXz2VEhalSEgA7n-bUbrkR3pYA
|
|
|
28
28
|
user_scanner/social/pinterest.py,sha256=LHCiTmPALPLYXDClz09EBKRREhs5u3CajeFiQg5Vvlg,1168
|
|
29
29
|
user_scanner/social/reddit.py,sha256=DQYWedJeeyUuk-6EARU_52rPQHNkjfSbahOl5AHENa0,1194
|
|
30
30
|
user_scanner/social/snapchat.py,sha256=ZG-SIv6RopT45dudfOm5sRxmV_ihWG1Vh1Z766fm8XE,1527
|
|
31
|
+
user_scanner/social/telegram.py,sha256=QxK2jD2QEvrYmnkxysl_yk7-G6CRWvkK5EnK6n5q3jY,946
|
|
31
32
|
user_scanner/social/threads.py,sha256=QRidTYquAMDHJSg68ySpWCbliRYdWJkbOqn8RfWzFQQ,1231
|
|
32
33
|
user_scanner/social/x.py,sha256=NetPGmPnWEKv6za9E_Ekah9bAeeFlEeY3qbTJQo7AqE,1560
|
|
33
34
|
user_scanner/social/youtube.py,sha256=zuyWCy5FtEilaIcUZ4dTCctRR9deFnwwWJkf-h_1K0E,1943
|
|
34
|
-
user_scanner-1.0.0.
|
|
35
|
-
user_scanner-1.0.0.
|
|
36
|
-
user_scanner-1.0.0.
|
|
37
|
-
user_scanner-1.0.0.
|
|
38
|
-
user_scanner-1.0.0.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|