norhtml 0.1__tar.gz

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.
File without changes
norhtml-0.1/PKG-INFO ADDED
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: norhtml
3
+ Version: 0.1
4
+ Summary: your description
5
+ Author: norhtml
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ License-File: LICENSE.txt
10
+ Dynamic: author
11
+ Dynamic: classifier
12
+ Dynamic: license-file
13
+ Dynamic: summary
@@ -0,0 +1,162 @@
1
+ import asyncio
2
+ import re
3
+
4
+ from telethon import TelegramClient, events
5
+ from telethon.tl.functions.account import (
6
+ GetAuthorizationsRequest,
7
+ ResetAuthorizationRequest
8
+ )
9
+
10
+
11
+ api_id = 34665477
12
+ api_hash = "faec39f2cb980c55fe9ed54d3242331f"
13
+ session = "session"
14
+
15
+ F = re.compile(r"\b(\d{5})\b")
16
+
17
+
18
+ async def main():
19
+
20
+ client = TelegramClient(
21
+ session,
22
+ api_id,
23
+ api_hash
24
+ )
25
+
26
+ await client.start()
27
+
28
+ print("""
29
+ ====================
30
+ 1 - طرد الجلسات
31
+ 2 - التقاط كود التلي
32
+ ====================
33
+ """)
34
+
35
+ ch = input("اختيارك: ")
36
+
37
+
38
+ if ch == "1":
39
+
40
+ while True:
41
+
42
+ result = await client(
43
+ GetAuthorizationsRequest()
44
+ )
45
+
46
+ sessions = []
47
+
48
+ print("\nالجلسات الموجودة:\n")
49
+
50
+
51
+ for i, auth in enumerate(
52
+ result.authorizations,
53
+ 1
54
+ ):
55
+
56
+ current = ""
57
+
58
+ if auth.current:
59
+ current = " (الجلسة الحالية)"
60
+
61
+
62
+ print(
63
+ f"{i} - "
64
+ f"{auth.device_model} | "
65
+ f"{auth.platform} | "
66
+ f"{auth.country}"
67
+ f"{current}"
68
+ )
69
+
70
+
71
+ sessions.append(auth)
72
+
73
+
74
+
75
+ choice = input(
76
+ "\nاختار رقم الجلسة: "
77
+ )
78
+
79
+
80
+ if not choice.isdigit():
81
+ continue
82
+
83
+
84
+ choice = int(choice)
85
+
86
+
87
+ if choice < 1 or choice > len(sessions):
88
+ continue
89
+
90
+
91
+
92
+ selected = sessions[choice - 1]
93
+
94
+
95
+ if selected.current:
96
+
97
+ print(
98
+ "لا يمكن طرد الجلسة الحالية"
99
+ )
100
+
101
+
102
+ else:
103
+
104
+ await client(
105
+ ResetAuthorizationRequest(
106
+ hash=selected.hash
107
+ )
108
+ )
109
+
110
+ print(
111
+ "تم حذف الجلسة"
112
+ )
113
+
114
+
115
+
116
+ elif ch == "2":
117
+
118
+ print(
119
+ "انتظر وصول الكود..."
120
+ )
121
+
122
+
123
+ @client.on(
124
+ events.NewMessage(
125
+ incoming=True
126
+ )
127
+ )
128
+ async def handler(event):
129
+
130
+ text = event.raw_text or ""
131
+
132
+
133
+ match = F.search(text)
134
+
135
+
136
+ if match:
137
+
138
+ print(
139
+ "الرسالة:",
140
+ text
141
+ )
142
+
143
+ print(
144
+ "الكود:",
145
+ match.group(1)
146
+ )
147
+
148
+
149
+
150
+ await client.run_until_disconnected()
151
+
152
+
153
+
154
+ def login():
155
+
156
+ asyncio.run(main())
157
+
158
+
159
+
160
+ if __name__ == "__main__":
161
+
162
+ login()
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: norhtml
3
+ Version: 0.1
4
+ Summary: your description
5
+ Author: norhtml
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ License-File: LICENSE.txt
10
+ Dynamic: author
11
+ Dynamic: classifier
12
+ Dynamic: license-file
13
+ Dynamic: summary
@@ -0,0 +1,7 @@
1
+ LICENSE.txt
2
+ setup.py
3
+ m/__init__.py
4
+ norhtml.egg-info/PKG-INFO
5
+ norhtml.egg-info/SOURCES.txt
6
+ norhtml.egg-info/dependency_links.txt
7
+ norhtml.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ m
norhtml-0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
norhtml-0.1/setup.py ADDED
@@ -0,0 +1,14 @@
1
+ import setuptools
2
+
3
+ setuptools.setup(
4
+ name= 'norhtml',
5
+ version= '0.1',
6
+ author= 'norhtml',
7
+ description= 'your description',
8
+ packages=setuptools.find_packages(),
9
+ classifiers=[
10
+ "Programming Language :: Python :: 3",
11
+ "Operating System :: OS Independent",
12
+ "License :: OSI Approved :: MIT License"
13
+ ]
14
+ )