Closed fortysix2ahead closed 2 years ago
Nice catch..let me have a look as soon I am free
Might be that Synology is not consistent here. I have more improvements regarding Photos. I forked your repo, you can already take a look.
That is great I will go through
Hi, so I am running DSM 7 and after running few tests I did not find any issue to log into photo even with session
variable although there are few functions to be fixed i was able to use many of them without issues, could you tell me what is exactly what it says when you log in?
Did more testing and now it gets weird. On a Macbook the original unpatched code runs without any issues. The same code fails on a Windows machine. The code line in question is this: https://github.com/N4S4/synology-api/blob/f342f0b33664299b0c7564b2d8eea00167169ec5/synology_api/auth.py#L41
The response on the Macbook is fine. On the Windows machine however, the response code is 200 with the payload being:
{"error":{"code":402},"success":false}
Then of course the next line session_request.json()['data']['sid']
fails as there's no 'data' in response.json(). Do we have an idea what error 402 means?
According to https://global.download.synology.com/download/Document/Software/DeveloperGuide/Os/DSM/All/enu/DSM_Login_Web_API_Guide_enu.pdf error 402 means permission denied.
Reverted changes to auth.py as they do not seem to be needed for Photos.
Strange i am working on a windows and linux both are working fine. I will just close the PR as no previous merge has been made. Also what improvements have u done to the photo module?
Maybe that was a bit too early, this PR also contained a fix for not being able to count folder contents. Shall I reopen? Or make a new one?
Oh ok sorry my fault, can u make a new one without tests file? With just the fix Thank you for the support anyway
Done.
Please verify fix on your device. At least on my NAS, running DSM 7.0, a login was not possible. It worked only after removing the session key from the params dict. Not sure if this happens also when trying to login to other Synology services. Tried with FileStation and it worked with the session key being present.