Hello all,
I have written several python scripts to improve my OSMC / RPi2. I use XBMC built in functions (for example for mute/unmute in python scripts I use: xbmc.executebuiltin(‘xbmc.Mute()’) )
I need to get information about the current volume level in XBMC.
I cannot find a built in function (http://kodi.wiki/view/List_of_built-in_functions ) returning volume level info, there is only a set volume function: SetVolume(percent[,showvolumebar]).
JSON-RPC (http://kodi.wiki/view/JSON-RPC_API/v2#XBMC.GetVolume ) provides a function to retrieve volume level info (XBMC.GetVolume).
Is there some simple way to get volume level info from XBMC in python scripts w/o the need to use JSON-RPC?
Thank you.
You can use kodi-send or xbmc-send as a wrapper to the JSON API
Sam
1 Like
Perhaps texturecache.py can do this job
texturecache.py
===============
Utility to manage and update the local Kodi texture cache (Texture##.db and Thumbnails folder), view content of the Kodi media library using JSON calls (so works with MySQL too), and also cross reference cache with library to identify space saving opportunities or problems.
## Summary of features
*Typically a lower case option is harmless, an uppercase version may delete/modify data*
**[c, C]** Automatically re-cache missing artwork, with option to force download of existing artwork (remove first, then re-cache). Can use multiple threads (default is 2)
**[nc]** Identify those items that require caching (and would be cached by **c** option)
**[lc, lnc]** Same as `c` and `nc`, but only considers those media (movies, tvshows/episodes) added since the modification timestamp of the file identified by the property `lastrunfile`
**[p, P]** Prune texture cache by removing accumulated **cruft** such as image previews, previously deleted movies/tvshows/music and whose artwork remains in the texture cache even after cleaning the media library database. Essentially, remove any cached file that is no longer associated with an entry in the media library, or an addon
**[s, S]** Search texture cache for specific files and view database content, can help explain reason for incorrect artwork. **S** will only return database results for items that no longer exist in the filesystem.
**[x, X, f]** Extract rows from texture cache database, with optional SQL filter. **X** will only return database results for items that no longer exist in the filesystem. **f** will display basic stats (file count, total size).
This file has been truncated. show original