mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Get max api version for login. #1840
This commit is contained in:
parent
4103a7dc05
commit
a772748c78
1 changed files with 3 additions and 2 deletions
|
@ -15,8 +15,9 @@ class Authentication:
|
|||
self.app_api_list = {}
|
||||
|
||||
def login(self, application):
|
||||
get_api_list('SYNO.API.Auth')
|
||||
login_api = 'auth.cgi?api=SYNO.API.Auth'
|
||||
param = {'version': '2', 'method': 'login', 'account': self._username,
|
||||
param = {'version': self.app_api_list['SYNO.API.Auth']['maxVersion'], 'method': 'login', 'account': self._username,
|
||||
'passwd': self._password, 'session': application, 'format': 'cookie'}
|
||||
|
||||
if not self._session_expire:
|
||||
|
@ -31,7 +32,7 @@ class Authentication:
|
|||
|
||||
def logout(self, application):
|
||||
logout_api = 'auth.cgi?api=SYNO.API.Auth'
|
||||
param = {'version': '2', 'method': 'logout', 'session': application}
|
||||
param = {'version': self.app_api_list['SYNO.API.Auth']['maxVersion'], 'method': 'logout', 'session': application}
|
||||
|
||||
response = requests.get(self._base_url + logout_api, param)
|
||||
if response.json()['success'] is True:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue