tplinkrouterc6u 5.10.2__tar.gz → 5.10.3__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.
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/PKG-INFO +2 -2
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/README.md +1 -1
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/setup.py +1 -1
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/__init__.py +1 -0
- tplinkrouterc6u-5.10.3/tplinkrouterc6u/client/mr200.py +57 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u.egg-info/PKG-INFO +2 -2
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u.egg-info/SOURCES.txt +1 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/LICENSE +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/setup.cfg +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/__init__.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_c1200.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_c6u.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_c80.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_deco.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_ex.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_mr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_wdr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/test/test_client_xdr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/__init__.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/c1200.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/c5400x.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/c6u.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/c80.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/deco.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/ex.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/mr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/vr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/wdr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client/xdr.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/client_abstract.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/common/__init__.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/common/dataclass.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/common/encryption.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/common/exception.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/common/helper.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/common/package_enum.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u/provider.py +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u.egg-info/dependency_links.txt +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u.egg-info/requires.txt +0 -0
- {tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 5.10.
|
|
3
|
+
Version: 5.10.3
|
|
4
4
|
Summary: TP-Link Router API (supports also Mercusys Router)
|
|
5
5
|
Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
|
|
6
6
|
Author: Alex Erohin
|
|
@@ -343,7 +343,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
343
343
|
- Archer MR200 (v5, v5.3, v6.0)
|
|
344
344
|
- Archer MR550 v1
|
|
345
345
|
- Archer MR600 (v1, v2, v3)
|
|
346
|
-
- Archer NX200
|
|
346
|
+
- Archer NX200 v2.0
|
|
347
347
|
- Archer VR400 v3
|
|
348
348
|
- Archer VR600 v3
|
|
349
349
|
- Archer VR900v
|
|
@@ -311,7 +311,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
311
311
|
- Archer MR200 (v5, v5.3, v6.0)
|
|
312
312
|
- Archer MR550 v1
|
|
313
313
|
- Archer MR600 (v1, v2, v3)
|
|
314
|
-
- Archer NX200
|
|
314
|
+
- Archer NX200 v2.0
|
|
315
315
|
- Archer VR400 v3
|
|
316
316
|
- Archer VR600 v3
|
|
317
317
|
- Archer VR900v
|
|
@@ -2,6 +2,7 @@ from tplinkrouterc6u.client.c6u import TplinkRouter
|
|
|
2
2
|
from tplinkrouterc6u.client.deco import TPLinkDecoClient
|
|
3
3
|
from tplinkrouterc6u.client_abstract import AbstractRouter
|
|
4
4
|
from tplinkrouterc6u.client.mr import TPLinkMRClient
|
|
5
|
+
from tplinkrouterc6u.client.mr200 import TPLinkMR200Client
|
|
5
6
|
from tplinkrouterc6u.client.ex import TPLinkEXClient
|
|
6
7
|
from tplinkrouterc6u.client.vr import TPLinkVRClient
|
|
7
8
|
from tplinkrouterc6u.client.c80 import TplinkC80Router
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
from tplinkrouterc6u.common.exception import ClientException, AuthorizeError
|
|
3
|
+
from tplinkrouterc6u.client.mr import TPLinkMRClient
|
|
4
|
+
from Crypto.PublicKey import RSA
|
|
5
|
+
from re import search
|
|
6
|
+
from binascii import hexlify
|
|
7
|
+
from Crypto.Cipher import PKCS1_v1_5
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TPLinkMR200Client(TPLinkMRClient):
|
|
11
|
+
|
|
12
|
+
def authorize(self) -> None:
|
|
13
|
+
params = self.__get_params()
|
|
14
|
+
|
|
15
|
+
# Construct the RSA public key manually using modulus (n) and exponent (e)
|
|
16
|
+
n = int(params["nn"])
|
|
17
|
+
e = int(params["ee"])
|
|
18
|
+
pub_key = RSA.construct((n, e))
|
|
19
|
+
|
|
20
|
+
# Create an RSA cipher with PKCS#1 v1.5 padding (same as rsa.encrypt)
|
|
21
|
+
cipher = PKCS1_v1_5.new(pub_key)
|
|
22
|
+
|
|
23
|
+
# Encrypt username
|
|
24
|
+
rsa_username = cipher.encrypt(self.username.encode("utf-8"))
|
|
25
|
+
rsa_username_hex = hexlify(rsa_username).decode("utf-8")
|
|
26
|
+
|
|
27
|
+
# Encrypt password (after base64 encoding, as in your original code)
|
|
28
|
+
rsa_password = cipher.encrypt(base64.b64encode(self.password.encode("utf-8")))
|
|
29
|
+
rsa_password_hex = hexlify(rsa_password).decode("utf-8")
|
|
30
|
+
|
|
31
|
+
# Send login request
|
|
32
|
+
self.req.post(
|
|
33
|
+
f'{self.host}/cgi/login?UserName={rsa_username_hex}&Passwd={rsa_password_hex}&Action=1&LoginStatus=0'
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Try to extract token
|
|
37
|
+
r = self.req.get(self.host)
|
|
38
|
+
try:
|
|
39
|
+
self._token = search(r'var token="(.*)";', r.text).group(1)
|
|
40
|
+
except AttributeError:
|
|
41
|
+
raise AuthorizeError()
|
|
42
|
+
|
|
43
|
+
def __get_params(self, retry=False):
|
|
44
|
+
try:
|
|
45
|
+
r = self.req.get(f"{self.host}/cgi/getParm", timeout=5)
|
|
46
|
+
result = {}
|
|
47
|
+
for line in r.text.splitlines()[0:2]:
|
|
48
|
+
match = search(r"var (.*)=\"(.*)\"", line)
|
|
49
|
+
result[match.group(1)] = int(match.group(2), 16)
|
|
50
|
+
return result
|
|
51
|
+
except Exception:
|
|
52
|
+
if not retry:
|
|
53
|
+
return self.__get_params(True)
|
|
54
|
+
raise ClientException()
|
|
55
|
+
|
|
56
|
+
def _request(self, url, method='POST', data_str=None, encrypt=False, is_login=False):
|
|
57
|
+
return super()._request(url, method, data_str, False, is_login)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 5.10.
|
|
3
|
+
Version: 5.10.3
|
|
4
4
|
Summary: TP-Link Router API (supports also Mercusys Router)
|
|
5
5
|
Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
|
|
6
6
|
Author: Alex Erohin
|
|
@@ -343,7 +343,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
343
343
|
- Archer MR200 (v5, v5.3, v6.0)
|
|
344
344
|
- Archer MR550 v1
|
|
345
345
|
- Archer MR600 (v1, v2, v3)
|
|
346
|
-
- Archer NX200
|
|
346
|
+
- Archer NX200 v2.0
|
|
347
347
|
- Archer VR400 v3
|
|
348
348
|
- Archer VR600 v3
|
|
349
349
|
- Archer VR900v
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tplinkrouterc6u-5.10.2 → tplinkrouterc6u-5.10.3}/tplinkrouterc6u.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|