N4S4 / synology-api

A Python wrapper around Synology API
MIT License
384 stars 142 forks source link

Response is not a json so login syntax does not work #91

Closed 300LiterPropofol closed 2 years ago

300LiterPropofol commented 2 years ago

Hi!

Thank you first for writing this package! I was using the official document myself and tried to use those API with python in code instead of pasting their API in browser directly.

I then encountered an error whenever I want to do response.json()

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 

I tried your package and it is the same error. In auth.py login function, line

self._sid = session_request.json()['data']['sid']

shows an syntax error of json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). I printed the response.text out and it is a long <!doctype html> <html> <head> <script async src="https://www.googletagmanager.com/gta........ HTML string.

I wonder whether you have encountered this issue when developing this package. In your case, your response.json() does not show any error?

N4S4 commented 2 years ago

Hi,

no I did not encounter the same issue. I am using it regularly, without the _sid the package would not work at all,. I think the problem is isolated for you and needs to be looked elsewhere, have you tried tu run on another workstation? what version of python are you using?

N4S4 commented 2 years ago

closed for inactivity