Probably I have lack of basic knowledge...
I've found all (I hope) data I need, created script on kodi device with samples as you wrote in github:
I have built string like this:
{"jsonrpc":"2.0","method":"Player.Open","params": { "item": { "file": "plugin://plugin.audio.radiode/?mode=play_stream&data=%7B%22id%22%3A+%22dalmacija%22%2C"} }, "id": 1}
...and - how to use it properly?
It does not work in browser
http://IPADDR:8080/jsonrpc?request={%22j...id%22:%201}
Response: {"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}
In log I can see
JSONRPC: Failed to parse '{"jsonrpc":"2.0","method":"Player.Open","params": { "item": { "file": "plugin://plugin.audio.radiode/?mode=play_stream'
So, '&' is not correctly decoded - I've changed it to &, but result is the same.
Same from python scripts when I can easily use for example: {"jsonrpc":"2.0","method":"Application.SetVolume","params":{"volume":"increment"},"id":1 } to increment volume
It causes as below.
What to do?
Quote:2024-05-26 15:49:42.494 T:659454 debug <CWebserver[8080]>: request received for /jsonrpc
2024-05-26 15:49:42.494 T:659454 debug <general>: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Player.Open","params": { "item": { "file": "plugin://plugin.audio.radiode/?mode=play_stream&data=%7B%22id%22%3A+%22dalmacija%22%2C"} }, "id": 1}
2024-05-26 15:49:42.530 T:1718 debug <general>: CScriptRunner: running add-on script Radio.de('plugin://plugin.audio.radiode/', '58', '?mode=play_stream&data=%7B%22id%22%3A+%22dalmacija%22%2C')
2024-05-26 15:49:42.530 T:659455 debug <general>: Thread LanguageInvoker start, auto delete: false
2024-05-26 15:49:42.530 T:659455 debug <general>: initializing python engine.
2024-05-26 15:49:42.530 T:659455 debug <general>: CPythonInvoker(339, /storage/.kodi/addons/plugin.audio.radiode/addon.py): start processing
2024-05-26 15:49:42.551 T:659456 debug <general>: Thread ScriptObs start, auto delete: false
2024-05-26 15:49:42.573 T:659455 debug <general>: -->Python Interpreter Initialized<--
2024-05-26 15:49:42.573 T:659455 debug <general>:
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339, /storage/.kodi/addons/plugin.audio.radiode/addon.py): the source file to load is "/storage/.kodi/addons/plugin.audio.radiode/addon.py"
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): full python path:
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): custom python path:
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /storage/.kodi/addons/plugin.audio.radiode
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /storage/.kodi/addons/script.module.certifi/lib
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /storage/.kodi/addons/script.module.chardet/lib
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /storage/.kodi/addons/script.module.idna/lib
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /storage/.kodi/addons/script.module.requests/lib
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /storage/.kodi/addons/script.module.urllib3/lib
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): default python path:
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /usr/lib/python311.zip
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /usr/lib/python3.11
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /usr/lib/python3.11/lib-dynload
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): /usr/lib/python3.11/site-packages
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): adding args:
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): plugin://plugin.audio.radiode/
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): 58
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): ?mode=play_stream&data=%7B%22id%22%3A+%22dalmacija%22%2C
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339): resume:false
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339, /storage/.kodi/addons/plugin.audio.radiode/addon.py): entering source directory /storage/.kodi/addons/plugin.audio.radiode
2024-05-26 15:49:42.573 T:659455 debug <general>: CPythonInvoker(339, /storage/.kodi/addons/plugin.audio.radiode/addon.py): instantiating addon using automatically obtained id of "plugin.audio.radiode" dependent on version 3.0.0 of the xbmc.python api
2024-05-26 15:49:42.751 T:1718 debug <general>: ------ Window Init (DialogBusy.xml) ------
2024-05-26 15:49:42.778 T:659455 debug <CAddonSettings[0@plugin.audio.radiode]>: trying to load setting definitions from old format...
2024-05-26 15:49:42.781 T:659455 info <general>: Skipped 1 duplicate messages..
2024-05-26 15:49:42.781 T:659455 debug <general>: [Radio.de]: Dispatcher AddOn args: {'mode': 'play_stream', 'data': '{"id": "dalmacija",'}
2024-05-26 15:49:42.783 T:659455 error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'json.decoder.JSONDecodeError'>
Error Contents: Expecting property name enclosed in double quotes: line 1 column 20 (char 19)
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.audio.radiode/addon.py", line 15, in <module>
dispatcher.route()
File "/storage/.kodi/addons/plugin.audio.radiode/addon_utils.py", line 127, in route
data = json.loads(data)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
File "/usr/lib/python3.11/json/decoder.py", line 353, in raw_decode
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 20 (char 19)
-->End of Python script error report<--
2024-05-26 15:49:42.784 T:659455 debug <general>: onExecutionDone(339, /storage/.kodi/addons/plugin.audio.radiode/addon.py)
2024-05-26 15:49:42.784 T:1718 debug <general>: ------ Window Init (DialogNotification.xml) ------
2024-05-26 15:49:42.801 T:659455 debug <general>: .
2024-05-26 15:49:42.850 T:1718 debug <general>: CGLContextEGL::SwapBuffers: sync check blocking
2024-05-26 15:49:42.860 T:659455 debug <general>: Python interpreter stopped
2024-05-26 15:49:42.860 T:659455 debug <general>: Thread LanguageInvoker 140225347040960 terminating
2024-05-26 15:49:42.863 T:1718 debug <general>: CGLContextEGL::SwapBuffers: sync sleep: 12497
2024-05-26 15:49:42.872 T:659456 debug <general>: Thread ScriptObs 140224382121664 terminating
2024-05-26 15:49:42.879 T:1718 debug <general>: ------ Window Deinit (DialogBusy.xml) ------
2024-05-26 15:49:52.497 T:1718 debug <general>: ------ Window Deinit (DialogNotification.xml) ------