View Full Version : How to get XBMC version from Python?
Dan Dare
2009-07-05, 18:18
Hi,
Is there a way to get the XBMC version/build from a Python script/plugin? And possibily the OS name & version. Trying to build a User-Agent string here.
Thanks,
Dan
rwparris2
2009-07-06, 06:03
httpapi to get builddate & version number. I don't know which is which, this is straight from the wiki. There might be a better way to get this but this is all I know off top of my head:
http://xbox/xbmcCmds/xbmcHttp?command=GetSystemInfo(120;121)
import platform
print platform.system(), platform.release()
this works well on windows, I cannot test linux or macosx or xbox at the moment.
iirc, AMTLite uses some other method (most likely in the download module), I cannot remember what it is though.
BigBellyBilly
2009-07-06, 11:50
simplest way is:
xbmc_version = xbmc.getInfoLabel( "System.BuildVersion" )
example: 9.04-alpha1 r19293
Then you can parse it (string funcs or regex) to extract the bits you need
Dan Dare
2009-07-06, 16:09
Thanks guys, much appreciated.
@rwparris2
GetSystemInfo() returns version, build and date, nice.
I found later on the platform package, but for some reason it crashes my XBMC 9.04.1 on Windows XP (CThread::staticThread : Access violation) when calling the any method.
@BigBellyBilly
Thanks BBB - I'm new to InfoLabels, appears you can get quite a bit of information from those (http://www.xbmc.org/wiki/?title=InfoLabels), thanks.