stvtermux 1.0.2__py3-none-any.whl → 1.0.4__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.
- stvtermux/__init__.py +2 -2
- stvtermux/cli.py +5 -5
- stvtermux/core.py +6 -3
- stvtermux/index.py +1 -0
- {stvtermux-1.0.2.dist-info → stvtermux-1.0.4.dist-info}/METADATA +1 -1
- stvtermux-1.0.4.dist-info/RECORD +9 -0
- stvtermux-1.0.2.dist-info/RECORD +0 -8
- {stvtermux-1.0.2.dist-info → stvtermux-1.0.4.dist-info}/WHEEL +0 -0
- {stvtermux-1.0.2.dist-info → stvtermux-1.0.4.dist-info}/entry_points.txt +0 -0
- {stvtermux-1.0.2.dist-info → stvtermux-1.0.4.dist-info}/top_level.txt +0 -0
stvtermux/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
from
|
2
|
-
|
1
|
+
from .cli import main
|
2
|
+
from .core import Auth
|
stvtermux/cli.py
CHANGED
@@ -5,14 +5,14 @@ def main():
|
|
5
5
|
|
6
6
|
print("===== 🌐 STVTermux Login System 🌐 =====")
|
7
7
|
while True:
|
8
|
-
choice = input("👉 Bạn muốn
|
8
|
+
choice = input("👉 Bạn muốn:\n(1) Đăng ký hay\n(2) Đăng nhập? ")
|
9
9
|
if choice == "1":
|
10
|
-
u = input("
|
11
|
-
p = input("
|
10
|
+
u = input("username: ")
|
11
|
+
p = input("password: ")
|
12
12
|
auth.register(u, p)
|
13
13
|
elif choice == "2":
|
14
|
-
u = input("
|
15
|
-
p = input("
|
14
|
+
u = input("username: ")
|
15
|
+
p = input("password: ")
|
16
16
|
auth.login(u, p)
|
17
17
|
else:
|
18
18
|
print("Chọn 1 hoặc 2!")
|
stvtermux/core.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import requests
|
2
2
|
import json
|
3
|
+
import subprocess
|
3
4
|
|
4
5
|
FIREBASE_URL = "https://sever-login-ae5cc-default-rtdb.firebaseio.com/player.json"
|
5
6
|
|
@@ -8,7 +9,6 @@ class Auth:
|
|
8
9
|
self.firebase_url = firebase_url
|
9
10
|
|
10
11
|
def register(self, username: str, password: str) -> bool:
|
11
|
-
"""Đăng ký tài khoản mới"""
|
12
12
|
res = requests.get(self.firebase_url)
|
13
13
|
if res.status_code != 200:
|
14
14
|
print("❌ Lỗi kết nối server!")
|
@@ -29,7 +29,6 @@ class Auth:
|
|
29
29
|
return False
|
30
30
|
|
31
31
|
def login(self, username: str, password: str) -> bool:
|
32
|
-
"""Đăng nhập tài khoản"""
|
33
32
|
res = requests.get(self.firebase_url)
|
34
33
|
if res.status_code != 200:
|
35
34
|
print("❌ Lỗi kết nối server!")
|
@@ -39,7 +38,11 @@ class Auth:
|
|
39
38
|
for _, user in data.items():
|
40
39
|
if user.get("username") == username and user.get("password") == password:
|
41
40
|
print("✅ Đăng nhập thành công!")
|
41
|
+
subprocess.run(["python", "index.py"])
|
42
42
|
return True
|
43
43
|
|
44
44
|
print("❌ Sai username hoặc password!")
|
45
|
-
return False
|
45
|
+
return False
|
46
|
+
|
47
|
+
|
48
|
+
|
stvtermux/index.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
print("🎉 Xin chào! Bạn đã vào file in.py")
|
@@ -0,0 +1,9 @@
|
|
1
|
+
stvtermux/__init__.py,sha256=bk7kIC3tSACeEbiYSYrJEpHxwr6DswGbO-18EF-MDwM,45
|
2
|
+
stvtermux/cli.py,sha256=pmjeY6GyZMqPiXN_lzdrScaG5gBFtS7EHlhmb_Ld1PM,544
|
3
|
+
stvtermux/core.py,sha256=9SNhmGLpi8aV1hgJhT1Tl_SAcybjzge5H_GrgfLCC-g,1621
|
4
|
+
stvtermux/index.py,sha256=b4WvMdOSmzZJHQer2qTuPA60KfZ8TMHTtuB9z44zdaI,51
|
5
|
+
stvtermux-1.0.4.dist-info/METADATA,sha256=GhaQNaRmZCWWyON6fRzxK_KXQQly3rRjX7jkrEu12p0,100
|
6
|
+
stvtermux-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
stvtermux-1.0.4.dist-info/entry_points.txt,sha256=7b0IuLqKSWL2VMJxcTdMLZXBaPfYT1atz6wwBTqco9Q,43
|
8
|
+
stvtermux-1.0.4.dist-info/top_level.txt,sha256=6krSSYES7OG83FeLt7MWD5vG8MOwzYh_K3ju8lBNqwg,10
|
9
|
+
stvtermux-1.0.4.dist-info/RECORD,,
|
stvtermux-1.0.2.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
stvtermux/__init__.py,sha256=jO2dYCn26G5OUkVmDxV1o8emaODqrjFWFg_bUzv0chM,45
|
2
|
-
stvtermux/cli.py,sha256=VJNI75nECsVXAKaO7hkpqS7YtSRgmEODHc0AlXvoH8Q,569
|
3
|
-
stvtermux/core.py,sha256=Rke-UPrT-wDA_YC4K9hynQfW6g1KPB5V5Lqh2_NxPMk,1625
|
4
|
-
stvtermux-1.0.2.dist-info/METADATA,sha256=fODdkdwYyi2mOuIrOGvS_LEFZyu6TzFBDffSl7dHOqU,100
|
5
|
-
stvtermux-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
stvtermux-1.0.2.dist-info/entry_points.txt,sha256=7b0IuLqKSWL2VMJxcTdMLZXBaPfYT1atz6wwBTqco9Q,43
|
7
|
-
stvtermux-1.0.2.dist-info/top_level.txt,sha256=6krSSYES7OG83FeLt7MWD5vG8MOwzYh_K3ju8lBNqwg,10
|
8
|
-
stvtermux-1.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|