Comments (12)
Hi
Thank you for reporting
Actually it is not an expected behaviour.
Does happen the same with get_config()?
So if you set secure=True does not happen?
From your output seems like did not get the api list while logging in...strange
from synology-api.
With http
User logged in, new session started!
User logged in, new session started!
Traceback (most recent call last):
File "/usr/local/src/test.py", line 13, in
dwn.get_config()
File "/usr/local/src/synology_api/downloadstation.py", line 34, in get_config
info = self.download_list[api_name]
KeyError: 'SYNO.DownloadStation.Info'
Seems like it's the same issue with get_config()
With https
When I set secure to True then I get the folowing error
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 1010, in validate_conn
conn.connect()
File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 411, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/ssl.py", line 432, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/ssl.py", line 474, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests-2.28.2-py3.10.egg/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='10.x.x.10', port=5000): Max retries exceeded with url: /webapi/auth.cgi?api=SYNO.API.Auth&version=7&method=login&account=adminuser&passwd=password&session=FileStation&format=cookie (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)')))
from synology-api.
Also, same issue with Python 3.6.x
root@545491ad573b:/usr/local/src# python test.py
User logged in, new session started!
User logged in, new session started!
Traceback (most recent call last):
File "test.py", line 9, in
dwn.get_info()
File "/root/.pyenv/versions/3.6.0/lib/python3.6/site-packages/synology_api/downloadstation.py", line 26, in get_info
info = self.download_list[api_name]
KeyError: 'SYNO.DownloadStation.Info'
from synology-api.
What DSM version do you have on your NAS?
Are you actually using only http or https? Any opt code?
from synology-api.
DSM 7.1.1-42962 Update 1
Using only http for now, just got started with your API, will eventually switch to https which depends on how well this API could fit in our design :)
For now I did make FileStation work, by updating some of the paths in auth.py
from synology-api.
Ok i see....it is very strange, so even filestation did not work for you, I guess the entire api than
from synology-api.
ok so i tested on my synology and looks like is working and receiving data from http request without any modification,
I wanted to ask did you set the port correctly while initiating the function? (5000, or whatever u set as http)
Did you set automatic redirection to https?
not sure if is an isolated case for you, to be sure it should be tested with more
I am using DSM 7 Update 4
from synology-api.
Thats a bit strange to hear for me as well, last I checked on the PDFs available for DSM Login API, in the docs they are using entry.cgi
path, and yes if you look closely at the error logs I pasted above, I am using the 5000 port, and no I am not doing anything special, simply using the sample http example as is from the README.md
from synology-api.
I see the last bit of error was
HTTPSConnectionPool(host='10.x.x.10', port=5000): Max retries exceeded with url: /webapi/auth.cgi?api=SYNO.API.Auth&version=7&method=login&account=adminuser&passwd=password&session=FileStation&format=cookie (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)')))
It looks the request was made with secure =True
Can you post the bit of code where you initiate the class? Omitting sensitive data of course
from synology-api.
Yes, you are right, I did both tests... I updated the comment to show http vs https outputs. You may take another glance if you'd like :)
and, sure like I said I am just using the same example code from README.md
from synology_api import filestation, downloadstation
fl = filestation.FileStation('10.x.x.10', '5000', 'user', 'password', secure=False, cert_verify=False, dsm_version=7, debug=True, otp_code=None)
fl.get_info()
dwn = downloadstation.DownloadStation('10.x.x.10', '5000', 'user', 'password', secure=False, cert_verify=False, dsm_version=7, debug=True, otp_code=None)
dwn.get_info()
so, this doesn't work for me out of the box and it simply returns,
User logged in, new session started!
User logged in, new session started!
Traceback (most recent call last):
File "/usr/local/src/test.py", line 9, in
dwn.get_info()
File "/usr/local/src/synology_api/downloadstation.py", line 26, in get_info
info = self.download_list[api_name]
KeyError: 'SYNO.DownloadStation.Info'
from synology-api.
I been asking other users they do not experience the same, not sure what us going on
Also strange output for the code, you should have 'User logged in,.....'
Than fl.get_info() output instead of both logins
from synology-api.
Closed due to inactivity
from synology-api.
Related Issues (20)
- Machine oriented outputs for async start function HOT 2
- About Universal search Api parameter HOT 2
- `filestations.upload_file(...)` does not return anything meaninful anymore HOT 5
- Is it possible to make download station create task utilizing torrent file? HOT 6
- error code not match with api document HOT 2
- Upgrade to (at least) Python 3.8 HOT 3
- Command Line Interface Support HOT 5
- `Data request failed` blinker error since upgrade from `0.5.1` to `0.6.2` HOT 6
- `shutdown` request from SYNO.Core.System not working properly HOT 4
- Tasks for Active Backup for Business HOT 7
- DownloadStation.create_task cannot handle destinations with whitespace HOT 1
- Remove synology-api-cli branch HOT 3
- get a error when use the method rename_folder HOT 7
- Synology Surveillance Station integration HOT 11
- core_certificate upload_cert() not working HOT 6
- is it possible to access synology using this wrapper from public/making request from browser? HOT 2
- [Feature Request] Implement TaskScheduler API HOT 2
- filestation.FileStation() - "Error 402 - Denied permission" on version 0.7.x HOT 8
- Trapping errors HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synology-api.