There is something incorrect in your processing of upload token. Either urllib.unquote breaks something or some other processing harms.
BTW, have you tried without unquoting (leaving %3d untouched, not replaced to =) ?
The internal error for your request is that the parameter is not matching the value expected, it is just invalid. The problem is inside token=stoken arguments
PS: Since there is no official python API from ok (and not planned as well), and APIs you are using are heavily outdated, it might be better to send raw JSON api requests, instead of the wrapper that is possibly changing something unsupported way.
PPS: You can manually test arguments you are passing using online request form built-in for methods:
https://apiok.ru/en/dev/methods/rest/photosV2/phot...
and then
https://apiok.ru/en/dev/methods/rest/photosV2/phot...