tplinkrouterc6u 5.12.0__tar.gz → 5.12.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.
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/PKG-INFO +5 -1
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/README.md +4 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/setup.py +1 -1
- tplinkrouterc6u-5.12.1/test/test_client_mr_200.py +43 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/mr200.py +9 -9
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u.egg-info/PKG-INFO +5 -1
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u.egg-info/SOURCES.txt +1 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/LICENSE +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/setup.cfg +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/__init__.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_c1200.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_c6u.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_c80.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_deco.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_ex.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_mr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_re330.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_wdr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/test/test_client_xdr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/__init__.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/__init__.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/c1200.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/c5400x.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/c6u.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/c80.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/deco.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/ex.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/mr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/re330.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/vr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/wdr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client/xdr.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/client_abstract.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/common/__init__.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/common/dataclass.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/common/encryption.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/common/exception.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/common/helper.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/common/package_enum.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u/provider.py +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u.egg-info/dependency_links.txt +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u.egg-info/requires.txt +0 -0
- {tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/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.12.
|
|
3
|
+
Version: 5.12.1
|
|
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
|
|
@@ -323,6 +323,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
323
323
|
- Archer AX73 (V1, V2.0)
|
|
324
324
|
- Archer AX75 V1
|
|
325
325
|
- Archer AX90 V1.20
|
|
326
|
+
- Archer AX95 v1.0
|
|
326
327
|
- Archer AXE75 V1
|
|
327
328
|
- Archer AXE5400 v1.0
|
|
328
329
|
- Archer AXE16000
|
|
@@ -330,6 +331,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
330
331
|
- Archer AX3000 V1
|
|
331
332
|
- Archer AX6000 V1
|
|
332
333
|
- Archer AX11000 V1
|
|
334
|
+
- Archer BE220 v1.0
|
|
333
335
|
- Archer BE230 v1.0
|
|
334
336
|
- Archer BE400 v1.0
|
|
335
337
|
- Archer BE550 v1.0
|
|
@@ -391,6 +393,8 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
391
393
|
- VX420-G2h v1.1
|
|
392
394
|
- VX800v v1
|
|
393
395
|
- XC220-G3v v2.30
|
|
396
|
+
- RE305 4.0
|
|
397
|
+
- RE315 1.0
|
|
394
398
|
- RE330 v1
|
|
395
399
|
### <a id="mercusys">MERCUSYS routers</a>
|
|
396
400
|
- AC10 1.20
|
|
@@ -290,6 +290,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
290
290
|
- Archer AX73 (V1, V2.0)
|
|
291
291
|
- Archer AX75 V1
|
|
292
292
|
- Archer AX90 V1.20
|
|
293
|
+
- Archer AX95 v1.0
|
|
293
294
|
- Archer AXE75 V1
|
|
294
295
|
- Archer AXE5400 v1.0
|
|
295
296
|
- Archer AXE16000
|
|
@@ -297,6 +298,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
297
298
|
- Archer AX3000 V1
|
|
298
299
|
- Archer AX6000 V1
|
|
299
300
|
- Archer AX11000 V1
|
|
301
|
+
- Archer BE220 v1.0
|
|
300
302
|
- Archer BE230 v1.0
|
|
301
303
|
- Archer BE400 v1.0
|
|
302
304
|
- Archer BE550 v1.0
|
|
@@ -358,6 +360,8 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
358
360
|
- VX420-G2h v1.1
|
|
359
361
|
- VX800v v1
|
|
360
362
|
- XC220-G3v v2.30
|
|
363
|
+
- RE305 4.0
|
|
364
|
+
- RE315 1.0
|
|
361
365
|
- RE330 v1
|
|
362
366
|
### <a id="mercusys">MERCUSYS routers</a>
|
|
363
367
|
- AC10 1.20
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from unittest import main, TestCase
|
|
2
|
+
from unittest.mock import patch, MagicMock
|
|
3
|
+
from requests import Session
|
|
4
|
+
from tplinkrouterc6u import TPLinkMR200Client
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TestTPLinkMR200Client(TestCase):
|
|
8
|
+
def setUp(self):
|
|
9
|
+
self.obj = TPLinkMR200Client('', '')
|
|
10
|
+
|
|
11
|
+
def test_supports_false(self):
|
|
12
|
+
responses = [
|
|
13
|
+
'var param1="0x1A"\nvar param2="0x2B"\nignored line\n',
|
|
14
|
+
'404',
|
|
15
|
+
'var nn="dfgdfg"\nvar ee="0x2B"\n'
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
fake_responses = []
|
|
19
|
+
for text in responses:
|
|
20
|
+
r = MagicMock()
|
|
21
|
+
r.text = text
|
|
22
|
+
fake_responses.append(r)
|
|
23
|
+
|
|
24
|
+
with patch.object(Session, "get", side_effect=fake_responses):
|
|
25
|
+
for _ in range(len(fake_responses)):
|
|
26
|
+
result = self.obj.supports()
|
|
27
|
+
self.assertFalse(result)
|
|
28
|
+
|
|
29
|
+
def test_supports_true(self):
|
|
30
|
+
fake_response = MagicMock()
|
|
31
|
+
fake_response.text = (
|
|
32
|
+
'var nn="0x1A"\n'
|
|
33
|
+
'var ee="0x2B"\n'
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
with patch.object(Session, "get", return_value=fake_response):
|
|
37
|
+
result = self.obj.supports()
|
|
38
|
+
|
|
39
|
+
self.assertEqual(result, True)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if __name__ == '__main__':
|
|
43
|
+
main()
|
|
@@ -22,12 +22,10 @@ class TPLinkMR200Client(TPLinkMRClient):
|
|
|
22
22
|
return False
|
|
23
23
|
|
|
24
24
|
def authorize(self) -> None:
|
|
25
|
-
|
|
25
|
+
self.__get_params()
|
|
26
26
|
|
|
27
27
|
# Construct the RSA public key manually using modulus (n) and exponent (e)
|
|
28
|
-
|
|
29
|
-
e = int(params["ee"])
|
|
30
|
-
pub_key = RSA.construct((n, e))
|
|
28
|
+
pub_key = RSA.construct((self._nn, self._ee))
|
|
31
29
|
|
|
32
30
|
# Create an RSA cipher with PKCS#1 v1.5 padding (same as rsa.encrypt)
|
|
33
31
|
cipher = PKCS1_v1_5.new(pub_key)
|
|
@@ -116,7 +114,7 @@ class TPLinkMR200Client(TPLinkMRClient):
|
|
|
116
114
|
|
|
117
115
|
return status
|
|
118
116
|
|
|
119
|
-
def __get_params(self, retry=False):
|
|
117
|
+
def __get_params(self, retry=False) -> None:
|
|
120
118
|
self.req.headers = {'referer': f'{self.host}/', 'origin': self.host}
|
|
121
119
|
try:
|
|
122
120
|
r = self.req.get(f"{self.host}/cgi/getParm", timeout=5)
|
|
@@ -124,11 +122,13 @@ class TPLinkMR200Client(TPLinkMRClient):
|
|
|
124
122
|
for line in r.text.splitlines()[0:2]:
|
|
125
123
|
match = search(r"var (.*)=\"(.*)\"", line)
|
|
126
124
|
result[match.group(1)] = int(match.group(2), 16)
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
|
|
126
|
+
self._nn = int(result["nn"])
|
|
127
|
+
self._ee = int(result["ee"])
|
|
128
|
+
except Exception as e:
|
|
129
129
|
if not retry:
|
|
130
|
-
|
|
131
|
-
raise ClientException()
|
|
130
|
+
self.__get_params(True)
|
|
131
|
+
raise ClientException(str(e))
|
|
132
132
|
|
|
133
133
|
def req_act(self, acts: list):
|
|
134
134
|
'''
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 5.12.
|
|
3
|
+
Version: 5.12.1
|
|
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
|
|
@@ -323,6 +323,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
323
323
|
- Archer AX73 (V1, V2.0)
|
|
324
324
|
- Archer AX75 V1
|
|
325
325
|
- Archer AX90 V1.20
|
|
326
|
+
- Archer AX95 v1.0
|
|
326
327
|
- Archer AXE75 V1
|
|
327
328
|
- Archer AXE5400 v1.0
|
|
328
329
|
- Archer AXE16000
|
|
@@ -330,6 +331,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
330
331
|
- Archer AX3000 V1
|
|
331
332
|
- Archer AX6000 V1
|
|
332
333
|
- Archer AX11000 V1
|
|
334
|
+
- Archer BE220 v1.0
|
|
333
335
|
- Archer BE230 v1.0
|
|
334
336
|
- Archer BE400 v1.0
|
|
335
337
|
- Archer BE550 v1.0
|
|
@@ -391,6 +393,8 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
391
393
|
- VX420-G2h v1.1
|
|
392
394
|
- VX800v v1
|
|
393
395
|
- XC220-G3v v2.30
|
|
396
|
+
- RE305 4.0
|
|
397
|
+
- RE315 1.0
|
|
394
398
|
- RE330 v1
|
|
395
399
|
### <a id="mercusys">MERCUSYS routers</a>
|
|
396
400
|
- AC10 1.20
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tplinkrouterc6u-5.12.0 → tplinkrouterc6u-5.12.1}/tplinkrouterc6u.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|