tplinkrouterc6u 5.0.0__tar.gz → 5.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.
Files changed (22) hide show
  1. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/PKG-INFO +18 -2
  2. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/README.md +17 -1
  3. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/setup.py +1 -1
  4. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/__init__.py +1 -0
  5. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/client.py +130 -91
  6. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/exception.py +4 -0
  7. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u.egg-info/PKG-INFO +18 -2
  8. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/LICENSE +0 -0
  9. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/setup.cfg +0 -0
  10. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/test/__init__.py +0 -0
  11. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/test/test_client.py +0 -0
  12. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/test/test_client_c1200.py +0 -0
  13. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/test/test_client_deco.py +0 -0
  14. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/test/test_client_mr.py +0 -0
  15. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/dataclass.py +0 -0
  16. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/encryption.py +0 -0
  17. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/helper.py +0 -0
  18. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u/package_enum.py +0 -0
  19. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u.egg-info/SOURCES.txt +0 -0
  20. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u.egg-info/dependency_links.txt +0 -0
  21. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u.egg-info/requires.txt +0 -0
  22. {tplinkrouterc6u-5.0.0 → tplinkrouterc6u-5.0.1}/tplinkrouterc6u.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tplinkrouterc6u
3
- Version: 5.0.0
3
+ Version: 5.0.1
4
4
  Summary: TP-Link Router API
5
5
  Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
6
6
  Author: Alex Erohin
@@ -42,6 +42,7 @@ from tplinkrouterc6u import (
42
42
  TplinkRouterProvider,
43
43
  TplinkRouter,
44
44
  TplinkC1200Router,
45
+ TplinkC5400XRouter,
45
46
  TPLinkMRClient,
46
47
  TPLinkDecoClient,
47
48
  Connection
@@ -53,6 +54,10 @@ router = TplinkRouterProvider.get_client('http://192.168.0.1', 'password')
53
54
  # router = TplinkRouter('http://192.168.0.1', 'password')
54
55
  # You may also pass username if it is different and a logger to log errors as
55
56
  # router = TplinkRouter('http://192.168.0.1','password','admin2', Logger('test'))
57
+ # If you have the TP-link C5400X or similar, you can use the TplinkC5400XRouter class instead of the TplinkRouter class.
58
+ # Remember that the password for this router is different, here you need to use the web encrypted password.
59
+ # To get web encrypted password, read Web Encrypted Password section
60
+ # router = TplinkC5400XRouter('http://192.168.0.1','WebEncryptedPassword', Logger('test'))
56
61
 
57
62
  try:
58
63
  router.authorize() # authorizing
@@ -82,6 +87,16 @@ finally:
82
87
  The TP-Link Web Interface only supports upto 1 user logged in at a time (for security reasons, apparently).
83
88
  So before action you need to authorize and after logout
84
89
 
90
+ ### <a id="encrypted_pass">Web Encrypted Password</a>
91
+ If you got exception - `use web encrypted password instead. Check the documentation!`
92
+ or you have TP-link C5400X or similar router you need to get web encrypted password by these actions:
93
+ 1. Go to the login page of your router. (default: 192.168.0.1).
94
+ 2. Type in the password you use to login into the password field.
95
+ 3. Click somewhere else on the page so that the password field is not selected anymore.
96
+ 4. Open the JavaScript console of your browser (usually by pressing F12 and then clicking on "Console").
97
+ 5. Type `document.getElementById("login-password").value;`
98
+ 6. Copy the returned value as password and use it.
99
+
85
100
  ## Functions
86
101
  | Function | Args | Description | Return |
87
102
  |---|---|---|---|
@@ -232,8 +247,9 @@ So before action you need to authorize and after logout
232
247
  - Archer AX11000 V1
233
248
  - Archer BE800 v1.0
234
249
  - Archer BE805 v1.0
250
+ - Archer BE3600 1.6
235
251
  - Archer C1200 (v1.0, v2.0)
236
- - Archer C2300 v1.0
252
+ - Archer C2300 (v1.0, v2.0)
237
253
  - Archer C6 (v2.0, v3.0)
238
254
  - Archer C6U v1.0
239
255
  - Archer C7 (v4.0, v5.0)
@@ -20,6 +20,7 @@ from tplinkrouterc6u import (
20
20
  TplinkRouterProvider,
21
21
  TplinkRouter,
22
22
  TplinkC1200Router,
23
+ TplinkC5400XRouter,
23
24
  TPLinkMRClient,
24
25
  TPLinkDecoClient,
25
26
  Connection
@@ -31,6 +32,10 @@ router = TplinkRouterProvider.get_client('http://192.168.0.1', 'password')
31
32
  # router = TplinkRouter('http://192.168.0.1', 'password')
32
33
  # You may also pass username if it is different and a logger to log errors as
33
34
  # router = TplinkRouter('http://192.168.0.1','password','admin2', Logger('test'))
35
+ # If you have the TP-link C5400X or similar, you can use the TplinkC5400XRouter class instead of the TplinkRouter class.
36
+ # Remember that the password for this router is different, here you need to use the web encrypted password.
37
+ # To get web encrypted password, read Web Encrypted Password section
38
+ # router = TplinkC5400XRouter('http://192.168.0.1','WebEncryptedPassword', Logger('test'))
34
39
 
35
40
  try:
36
41
  router.authorize() # authorizing
@@ -60,6 +65,16 @@ finally:
60
65
  The TP-Link Web Interface only supports upto 1 user logged in at a time (for security reasons, apparently).
61
66
  So before action you need to authorize and after logout
62
67
 
68
+ ### <a id="encrypted_pass">Web Encrypted Password</a>
69
+ If you got exception - `use web encrypted password instead. Check the documentation!`
70
+ or you have TP-link C5400X or similar router you need to get web encrypted password by these actions:
71
+ 1. Go to the login page of your router. (default: 192.168.0.1).
72
+ 2. Type in the password you use to login into the password field.
73
+ 3. Click somewhere else on the page so that the password field is not selected anymore.
74
+ 4. Open the JavaScript console of your browser (usually by pressing F12 and then clicking on "Console").
75
+ 5. Type `document.getElementById("login-password").value;`
76
+ 6. Copy the returned value as password and use it.
77
+
63
78
  ## Functions
64
79
  | Function | Args | Description | Return |
65
80
  |---|---|---|---|
@@ -210,8 +225,9 @@ So before action you need to authorize and after logout
210
225
  - Archer AX11000 V1
211
226
  - Archer BE800 v1.0
212
227
  - Archer BE805 v1.0
228
+ - Archer BE3600 1.6
213
229
  - Archer C1200 (v1.0, v2.0)
214
- - Archer C2300 v1.0
230
+ - Archer C2300 (v1.0, v2.0)
215
231
  - Archer C6 (v2.0, v3.0)
216
232
  - Archer C6U v1.0
217
233
  - Archer C7 (v4.0, v5.0)
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="tplinkrouterc6u",
8
- version="5.0.0",
8
+ version="5.0.1",
9
9
  author="Alex Erohin",
10
10
  author_email="alexanderErohin@yandex.ru",
11
11
  description="TP-Link Router API",
@@ -2,6 +2,7 @@ from tplinkrouterc6u.client import (
2
2
  TplinkRouter,
3
3
  TplinkRouterProvider,
4
4
  TplinkC1200Router,
5
+ TplinkC5400XRouter,
5
6
  TPLinkMRClient,
6
7
  AbstractRouter,
7
8
  TPLinkDecoClient,
@@ -14,7 +14,7 @@ from tplinkrouterc6u.helper import get_ip
14
14
  from tplinkrouterc6u.encryption import EncryptionWrapper, EncryptionWrapperMR
15
15
  from tplinkrouterc6u.package_enum import Connection
16
16
  from tplinkrouterc6u.dataclass import Firmware, Status, Device, IPv4Reservation, IPv4DHCPLease, IPv4Status
17
- from tplinkrouterc6u.exception import ClientException, ClientError
17
+ from tplinkrouterc6u.exception import ClientException, ClientError, AuthorizeError
18
18
  from abc import ABC, abstractmethod
19
19
 
20
20
 
@@ -108,7 +108,7 @@ class TplinkRequest:
108
108
  error = ('TplinkRouter - {} - Response with error; Request {} - Response {}'
109
109
  .format(self.__class__.__name__, path, data)) if not error else error
110
110
  if self._logger:
111
- self._logger.error(error)
111
+ self._logger.debug(error)
112
112
  raise ClientError(error)
113
113
 
114
114
  def _is_valid_response(self, data: dict) -> bool:
@@ -178,7 +178,7 @@ class TplinkEncryption(TplinkRequest):
178
178
  error = ("TplinkRouter - {} - Cannot authorize! Error - {}; Response - {}"
179
179
  .format(self.__class__.__name__, e, data))
180
180
  if self._logger:
181
- self._logger.error(error)
181
+ self._logger.debug(error)
182
182
  raise ClientException(error)
183
183
 
184
184
  def _request_pwd(self) -> None:
@@ -203,7 +203,7 @@ class TplinkEncryption(TplinkRequest):
203
203
  error = ('TplinkRouter - {} - Unknown error for pwd! Error - {}; Response - {}'
204
204
  .format(self.__class__.__name__, e, response.text))
205
205
  if self._logger:
206
- self._logger.error(error)
206
+ self._logger.debug(error)
207
207
  raise ClientException(error)
208
208
 
209
209
  def _request_seq(self) -> None:
@@ -230,7 +230,7 @@ class TplinkEncryption(TplinkRequest):
230
230
  error = ('TplinkRouter - {} - Unknown error for seq! Error - {}; Response - {}'
231
231
  .format(self.__class__.__name__, e, response.text))
232
232
  if self._logger:
233
- self._logger.error(error)
233
+ self._logger.debug(error)
234
234
  raise ClientException(error)
235
235
 
236
236
  def _try_login(self) -> Response:
@@ -658,7 +658,7 @@ class TplinkC6V4Router(AbstractRouter):
658
658
  return False
659
659
  if response.status_code == 401 and response.text.startswith('00'):
660
660
  raise ClientException(('Your router is not supported. Please add your router support to '
661
- 'https://github.com/AlexandrErohin/TP-Link-Archer-C6U'
661
+ 'https://github.com/AlexandrErohin/TP-Link-Archer-C6U '
662
662
  'by implementing methods for TplinkC6V4Router class'
663
663
  ))
664
664
  return False
@@ -682,7 +682,111 @@ class TplinkC6V4Router(AbstractRouter):
682
682
  raise ClientException('Not Implemented')
683
683
 
684
684
 
685
- class TplinkC1200Router(TplinkBaseRouter):
685
+ class TplinkC5400XRouter(TplinkBaseRouter):
686
+ def supports(self) -> bool:
687
+ return len(self.password) >= 200
688
+
689
+ def authorize(self) -> None:
690
+ if len(self.password) < 200:
691
+ raise Exception('You need to use web encrypted password instead. Check the documentation!')
692
+
693
+ url = '{}/cgi-bin/luci/;stok=/login?form=login'.format(self.host)
694
+
695
+ response = post(
696
+ url,
697
+ params={'operation': 'login', 'username': self.username, 'password': self.password},
698
+ headers=self._headers_login,
699
+ timeout=self.timeout,
700
+ verify=self._verify_ssl,
701
+ )
702
+
703
+ try:
704
+ self._stok = response.json().get('data').get('stok')
705
+ regex_result = search('sysauth=(.*);', response.headers['set-cookie'])
706
+ self._sysauth = regex_result.group(1)
707
+ self._logged = True
708
+ self._smart_network = False
709
+
710
+ except Exception as e:
711
+ error = "TplinkRouter - C5400X - Cannot authorize! Error - {}; Response - {}".format(e, response.text)
712
+ if self._logger:
713
+ self._logger.debug(error)
714
+ raise ClientException(error)
715
+
716
+ def set_led(self, enable: bool) -> None:
717
+ current_state = (self.request('admin/ledgeneral?form=setting&operation=read', 'operation=read')
718
+ .get('enable', 'off') == 'on')
719
+ if current_state != enable:
720
+ self.request('admin/ledgeneral?form=setting&operation=write', 'operation=write')
721
+
722
+ def get_led(self) -> bool:
723
+
724
+ data = self.request('admin/ledgeneral?form=setting&operation=read', 'operation=read')
725
+ led_status = data.get('enable') if 'enable' in data else None
726
+ if led_status == 'on':
727
+ return True
728
+ elif led_status == 'off':
729
+ return False
730
+ else:
731
+ return None
732
+
733
+ def set_wifi(self, wifi: Connection, enable: bool = None, ssid: str = None, hidden: str = None,
734
+ encryption: str = None, psk_version: str = None, psk_cipher: str = None, psk_key: str = None,
735
+ hwmode: str = None, htmode: str = None, channel: int = None, txpower: str = None,
736
+ disabled_all: str = None) -> None:
737
+ values = {
738
+ Connection.HOST_2G: 'wireless_2g',
739
+ Connection.HOST_5G: 'wireless_5g',
740
+ Connection.HOST_6G: 'wireless_6g',
741
+ Connection.GUEST_2G: 'guest_2g',
742
+ Connection.GUEST_5G: 'guest_5g',
743
+ Connection.GUEST_6G: 'guest_6g',
744
+ Connection.IOT_2G: 'iot_2g',
745
+ Connection.IOT_5G: 'iot_5g',
746
+ Connection.IOT_6G: 'iot_6g',
747
+ }
748
+
749
+ value = values.get(wifi)
750
+ if not value:
751
+ raise ValueError(f"Invalid Wi-Fi connection type: {wifi}")
752
+
753
+ if all(v is None for v in [enable, ssid, hidden, encryption, psk_version, psk_cipher, psk_key, hwmode,
754
+ htmode, channel, txpower, disabled_all]):
755
+ raise ValueError("At least one wireless setting must be provided")
756
+
757
+ data = "operation=write"
758
+
759
+ if enable is not None:
760
+ data += f"&enable={'on' if enable else 'off'}"
761
+ if ssid is not None:
762
+ data += f"&ssid={ssid}"
763
+ if hidden is not None:
764
+ data += f"&hidden={hidden}"
765
+ if encryption is not None:
766
+ data += f"&encryption={encryption}"
767
+ if psk_version is not None:
768
+ data += f"&psk_version={psk_version}"
769
+ if psk_cipher is not None:
770
+ data += f"&psk_cipher={psk_cipher}"
771
+ if psk_key is not None:
772
+ data += f"&psk_key={psk_key}"
773
+ if hwmode is not None:
774
+ data += f"&hwmode={hwmode}"
775
+ if htmode is not None:
776
+ data += f"&htmode={htmode}"
777
+ if channel is not None:
778
+ data += f"&channel={channel}"
779
+ if txpower is not None:
780
+ data += f"&txpower={txpower}"
781
+ if disabled_all is not None:
782
+ data += f"&disabled_all={disabled_all}"
783
+
784
+ path = f"admin/wireless?form={value}&{data}"
785
+
786
+ self.request(path, data)
787
+
788
+
789
+ class TplinkC1200Router(TplinkC5400XRouter):
686
790
  username = ''
687
791
  password = ''
688
792
  _pwdNN = ''
@@ -729,10 +833,11 @@ class TplinkC1200Router(TplinkBaseRouter):
729
833
  self._logged = True
730
834
 
731
835
  except Exception as e:
732
- error = ("TplinkRouter - C1200 - {} - Cannot authorize! Error - {}; Response - {}"
733
- .format(self.__class__.__name__, e, data))
836
+ error = ("TplinkRouter - C1200 - Cannot authorize! Error - {}; Response - {}".format(e, data))
734
837
  if self._logger:
735
- self._logger.error(error)
838
+ self._logger.debug(error)
839
+ if 'data' in vars() and data.get('errorcode') == 'login failed':
840
+ raise AuthorizeError(error)
736
841
  raise ClientException(error)
737
842
 
738
843
  def _request_pwd(self) -> None:
@@ -755,7 +860,7 @@ class TplinkC1200Router(TplinkBaseRouter):
755
860
  error = ('TplinkRouter - C1200 - {} - Unknown error for pwd! Error - {}; Response - {}'
756
861
  .format(self.__class__.__name__, e, response.text))
757
862
  if self._logger:
758
- self._logger.error(error)
863
+ self._logger.debug(error)
759
864
  raise ClientException(error)
760
865
 
761
866
  def _try_login(self) -> Response:
@@ -777,78 +882,6 @@ class TplinkC1200Router(TplinkBaseRouter):
777
882
  def _get_login_data(crypted_pwd: str) -> str:
778
883
  return 'operation=login&password={}'.format(crypted_pwd)
779
884
 
780
- def set_led(self, enable: bool) -> None:
781
- current_state = (self.request('admin/ledgeneral?form=setting&operation=read', 'operation=read')
782
- .get('enable', 'off') == 'on')
783
- if current_state != enable:
784
- self.request('admin/ledgeneral?form=setting&operation=write', 'operation=write')
785
-
786
- def get_led(self) -> bool:
787
-
788
- data = self.request('admin/ledgeneral?form=setting&operation=read', 'operation=read')
789
- led_status = data.get('enable') if 'enable' in data else None
790
- if led_status == 'on':
791
- return True
792
- elif led_status == 'off':
793
- return False
794
- else:
795
- return None
796
-
797
- def set_wifi(self, wifi: Connection, enable: bool = None, ssid: str = None, hidden: str = None,
798
- encryption: str = None, psk_version: str = None, psk_cipher: str = None, psk_key: str = None,
799
- hwmode: str = None, htmode: str = None, channel: int = None, txpower: str = None,
800
- disabled_all: str = None) -> None:
801
- values = {
802
- Connection.HOST_2G: 'wireless_2g',
803
- Connection.HOST_5G: 'wireless_5g',
804
- Connection.HOST_6G: 'wireless_6g',
805
- Connection.GUEST_2G: 'guest_2g',
806
- Connection.GUEST_5G: 'guest_5g',
807
- Connection.GUEST_6G: 'guest_6g',
808
- Connection.IOT_2G: 'iot_2g',
809
- Connection.IOT_5G: 'iot_5g',
810
- Connection.IOT_6G: 'iot_6g',
811
- }
812
-
813
- value = values.get(wifi)
814
- if not value:
815
- raise ValueError(f"Invalid Wi-Fi connection type: {wifi}")
816
-
817
- if all(v is None for v in [enable, ssid, hidden, encryption, psk_version, psk_cipher, psk_key, hwmode,
818
- htmode, channel, txpower, disabled_all]):
819
- raise ValueError("At least one wireless setting must be provided")
820
-
821
- data = "operation=write"
822
-
823
- if enable is not None:
824
- data += f"&enable={'on' if enable else 'off'}"
825
- if ssid is not None:
826
- data += f"&ssid={ssid}"
827
- if hidden is not None:
828
- data += f"&hidden={hidden}"
829
- if encryption is not None:
830
- data += f"&encryption={encryption}"
831
- if psk_version is not None:
832
- data += f"&psk_version={psk_version}"
833
- if psk_cipher is not None:
834
- data += f"&psk_cipher={psk_cipher}"
835
- if psk_key is not None:
836
- data += f"&psk_key={psk_key}"
837
- if hwmode is not None:
838
- data += f"&hwmode={hwmode}"
839
- if htmode is not None:
840
- data += f"&htmode={htmode}"
841
- if channel is not None:
842
- data += f"&channel={channel}"
843
- if txpower is not None:
844
- data += f"&txpower={txpower}"
845
- if disabled_all is not None:
846
- data += f"&disabled_all={disabled_all}"
847
-
848
- path = f"admin/wireless?form={value}&{data}"
849
-
850
- self.request(path, data)
851
-
852
885
 
853
886
  class TPLinkMRClient(AbstractRouter):
854
887
  REQUEST_RETRIES = 3
@@ -1168,7 +1201,7 @@ class TPLinkMRClient(AbstractRouter):
1168
1201
  if code != 200:
1169
1202
  error = 'TplinkRouter - MR - Response with error; Request {} - Response {}'.format(data, response)
1170
1203
  if self._logger:
1171
- self._logger.error(error)
1204
+ self._logger.debug(error)
1172
1205
  raise ClientError(error)
1173
1206
 
1174
1207
  result = self._merge_response(response)
@@ -1319,7 +1352,7 @@ class TPLinkMRClient(AbstractRouter):
1319
1352
 
1320
1353
  if error:
1321
1354
  if self._logger:
1322
- self._logger.error(error)
1355
+ self._logger.debug(error)
1323
1356
  raise ClientException(error)
1324
1357
 
1325
1358
  def _request(self, url, method='POST', data_str=None, encrypt=False):
@@ -1398,13 +1431,19 @@ class TPLinkMRClient(AbstractRouter):
1398
1431
  class TplinkRouterProvider:
1399
1432
  @staticmethod
1400
1433
  def get_client(host: str, password: str, username: str = 'admin', logger: Logger = None,
1401
- verify_ssl: bool = True, timeout: int = 30) -> AbstractRouter | None:
1402
- for client in [TPLinkMRClient, TplinkC6V4Router, TPLinkDecoClient, TplinkRouter, TplinkC1200Router]:
1434
+ verify_ssl: bool = True, timeout: int = 30) -> AbstractRouter:
1435
+ for client in [TplinkC5400XRouter, TPLinkMRClient, TplinkC6V4Router, TPLinkDecoClient, TplinkRouter]:
1403
1436
  router = client(host, password, username, logger, verify_ssl, timeout)
1404
1437
  if router.supports():
1405
1438
  return router
1406
1439
 
1407
- raise ClientException(('Your router is not supported. Please add your router support to '
1408
- 'https://github.com/AlexandrErohin/TP-Link-Archer-C6U'
1409
- 'by implementing methods for AbstractRouter class'
1410
- ))
1440
+ router = TplinkC1200Router(host, password, username, logger, verify_ssl, timeout)
1441
+ try:
1442
+ router.authorize()
1443
+ except AuthorizeError as e:
1444
+ logger.error(e.__str__())
1445
+ raise ClientException(('Login failed! Please check if your router local password is correct or '
1446
+ 'try to use web encrypted password instead. Check the documentation!'
1447
+ ))
1448
+
1449
+ raise ClientException('You need to use web encrypted password instead. Check the documentation!')
@@ -4,3 +4,7 @@ class ClientException(Exception):
4
4
 
5
5
  class ClientError(ClientException):
6
6
  pass
7
+
8
+
9
+ class AuthorizeError(ClientException):
10
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tplinkrouterc6u
3
- Version: 5.0.0
3
+ Version: 5.0.1
4
4
  Summary: TP-Link Router API
5
5
  Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
6
6
  Author: Alex Erohin
@@ -42,6 +42,7 @@ from tplinkrouterc6u import (
42
42
  TplinkRouterProvider,
43
43
  TplinkRouter,
44
44
  TplinkC1200Router,
45
+ TplinkC5400XRouter,
45
46
  TPLinkMRClient,
46
47
  TPLinkDecoClient,
47
48
  Connection
@@ -53,6 +54,10 @@ router = TplinkRouterProvider.get_client('http://192.168.0.1', 'password')
53
54
  # router = TplinkRouter('http://192.168.0.1', 'password')
54
55
  # You may also pass username if it is different and a logger to log errors as
55
56
  # router = TplinkRouter('http://192.168.0.1','password','admin2', Logger('test'))
57
+ # If you have the TP-link C5400X or similar, you can use the TplinkC5400XRouter class instead of the TplinkRouter class.
58
+ # Remember that the password for this router is different, here you need to use the web encrypted password.
59
+ # To get web encrypted password, read Web Encrypted Password section
60
+ # router = TplinkC5400XRouter('http://192.168.0.1','WebEncryptedPassword', Logger('test'))
56
61
 
57
62
  try:
58
63
  router.authorize() # authorizing
@@ -82,6 +87,16 @@ finally:
82
87
  The TP-Link Web Interface only supports upto 1 user logged in at a time (for security reasons, apparently).
83
88
  So before action you need to authorize and after logout
84
89
 
90
+ ### <a id="encrypted_pass">Web Encrypted Password</a>
91
+ If you got exception - `use web encrypted password instead. Check the documentation!`
92
+ or you have TP-link C5400X or similar router you need to get web encrypted password by these actions:
93
+ 1. Go to the login page of your router. (default: 192.168.0.1).
94
+ 2. Type in the password you use to login into the password field.
95
+ 3. Click somewhere else on the page so that the password field is not selected anymore.
96
+ 4. Open the JavaScript console of your browser (usually by pressing F12 and then clicking on "Console").
97
+ 5. Type `document.getElementById("login-password").value;`
98
+ 6. Copy the returned value as password and use it.
99
+
85
100
  ## Functions
86
101
  | Function | Args | Description | Return |
87
102
  |---|---|---|---|
@@ -232,8 +247,9 @@ So before action you need to authorize and after logout
232
247
  - Archer AX11000 V1
233
248
  - Archer BE800 v1.0
234
249
  - Archer BE805 v1.0
250
+ - Archer BE3600 1.6
235
251
  - Archer C1200 (v1.0, v2.0)
236
- - Archer C2300 v1.0
252
+ - Archer C2300 (v1.0, v2.0)
237
253
  - Archer C6 (v2.0, v3.0)
238
254
  - Archer C6U v1.0
239
255
  - Archer C7 (v4.0, v5.0)
File without changes