![]() |
Kodi Documentation
18.0
Kodi is an open source media player and entertainment hub.
|
General functions on Kodi. More...
Modules | |
InfoTagMusic | |
Kodi's music info tag class. | |
InfoTagRadioRDS | |
Kodi's radio RDS info tag class. | |
InfoTagVideo | |
Kodi's video info tag class. | |
Keyboard | |
Kodi's keyboard class. | |
Monitor | |
Kodi's monitor class. | |
Player | |
Kodi's player. | |
PlayList | |
Kodi's Play List class. | |
RenderCapture | |
Kodi's render capture. | |
Functions | |
log (...) | |
| |
shutdown () | |
| |
restart () | |
| |
executescript (...) | |
| |
executebuiltin (...) | |
| |
executeJSONRPC (...) | |
| |
sleep (...) | |
| |
getLocalizedString (...) | |
| |
getSkinDir () | |
| |
getLanguage (...) | |
| |
getIPAddress () | |
| |
getDVDState () | |
| |
getFreeMem () | |
| |
getInfoLabel (...) | |
| |
getInfoImage (...) | |
| |
playSFX (...) | |
| |
stopSFX () | |
| |
enableNavSounds (...) | |
| |
getCondVisibility (...) | |
| |
getGlobalIdleTime () | |
| |
getCacheThumbName (...) | |
| |
makeLegalFilename (...) | |
| |
translatePath (...) | |
| |
getCleanMovieTitle (...) | |
| |
validatePath (...) | |
| |
getRegion (...) | |
| |
getSupportedMedia (...) | |
| |
skinHasImage (...) | |
| |
startServer (...) | |
| |
audioSuspend () | |
| |
audioResume () | |
| |
getUserAgent () | |
| |
convertLanguage (...) | |
| |
General functions on Kodi.
Offers classes and functions that provide information about the media currently playing and that allow manipulation of the media player (such as starting a new song). You can also find system information using the functions available in this library.
audioResume | ( | ) |
Function: xbmc.audioResume()
Resume Audio engine.
Example:
audioSuspend | ( | ) |
Function: xbmc.audioSuspend()
Suspend Audio engine.
Example:
convertLanguage | ( | ... | ) |
Function: xbmc.convertLanguage(language, format)
Returns the given language converted to the given format as a string.
language | string either as name in English, two letter code (ISO 639-1), or three letter code (ISO 639-2/T(B) | ||||||||
format | format of the returned language string
|
Example:
enableNavSounds | ( | ... | ) |
Function: xbmc.enableNavSounds(yesNo)
Enables/Disables nav sounds
yesNo | integer - enable (True) or disable (False) nav sounds |
Example:
executebuiltin | ( | ... | ) |
Function: xbmc.executebuiltin(function)
Execute a built in Kodi function.
function | string - builtin function to execute. |
List of functions - http://kodi.wiki/view/List_of_Built_In_Functions
Example:
executeJSONRPC | ( | ... | ) |
Function: xbmc.executeJSONRPC(jsonrpccommand)
Execute an JSONRPC command.
jsonrpccommand | string - jsonrpc command to execute. |
List of commands -
Example:
executescript | ( | ... | ) |
Function: xbmc.executescript(script)
Execute a python script.
script | string - script filename to execute. |
Example:
getCacheThumbName | ( | ... | ) |
Function: xbmc.getCacheThumbName(path)
Get thumb cache filename.
path | string or unicode - path to file |
Example:
getCleanMovieTitle | ( | ... | ) |
Function: xbmc.getCleanMovieTitle(path[, usefoldername])
Get clean movie title and year string if available.
path | string or unicode - String to clean |
usefoldername | [opt] bool - use folder names (defaults to false) |
Example:
getCondVisibility | ( | ... | ) |
Function: xbmc.getCondVisibility(condition)
Get visibility conditions
condition | string - condition to check |
List of Conditions - http://kodi.wiki/view/List_of_Boolean_Conditions
Example:
getDVDState | ( | ) |
Function: xbmc.getDVDState()
Returns the dvd state as an integer.
Value | Name |
---|---|
1 | xbmc.DRIVE_NOT_READY |
16 | xbmc.TRAY_OPEN |
64 | xbmc.TRAY_CLOSED_NO_MEDIA |
96 | xbmc.TRAY_CLOSED_MEDIA_PRESENT |
Example:
getFreeMem | ( | ) |
Function: xbmc.getFreeMem()
Get amount of free memory in MB.
Example:
getGlobalIdleTime | ( | ) |
Function: xbmc.getGlobalIdleTime()
Get the elapsed idle time in seconds.
Example:
getInfoImage | ( | ... | ) |
Function: xbmc.getInfoImage(infotag)
Get filename including path to the InfoImage's thumbnail.
infotag | string - infotag for value you want returned |
List of InfoTags - http://kodi.wiki/view/InfoLabels
Example:
getInfoLabel | ( | ... | ) |
Function: xbmc.getInfoLabel(infotag)
Get a info label
infotag | string - infoTag for value you want returned. |
List of InfoTags - http://kodi.wiki/view/InfoLabels
Example:
getIPAddress | ( | ) |
Function: xbmc.getIPAddress()
Get the current ip address.
Example:
getLanguage | ( | ... | ) |
Function: xbmc.getLanguage([format], [region])
Get the active language.
format | [opt] format of the returned language string
| ||||||||
region | [opt] append the region delimited by "-" of the language (setting) to the returned language string |
Example:
getLocalizedString | ( | ... | ) |
Function: xbmc.getLocalizedString(id)
Get a localized 'unicode string'.
id | integer - id# for string you want to localize. |
\language\{yourlanguage}\
for which id you need for a string.Example:
getRegion | ( | ... | ) |
Function: xbmc.getRegion(id)
Returns your regions setting as a string for the specified id.
id | string - id of setting to return |
Example:
getSkinDir | ( | ) |
Function: xbmc.getSkinDir()
Get the active skin directory.
Example:
getSupportedMedia | ( | ... | ) |
Function: xbmc.getSupportedMedia(media)
Get the supported file types for the specific media.
media | string - media type |
Example:
getUserAgent | ( | ) |
log | ( | ... | ) |
Function: xbmc.log(msg[, level])
Write a string to Kodi's log file and the debug window.
msg | string - text to output. | ||||||||||||||
level | [opt] integer - log level to output at. (default=LOGDEBUG)
|
Text is written to the log for the following conditions.
Example:
makeLegalFilename | ( | ... | ) |
Function: xbmc.makeLegalFilename(filename[, fatX])
Returns a legal filename or path as a string.
filename | string or unicode - filename/path to make legal |
fatX | [opt] bool - True=Xbox file system(Default) |
Example:
playSFX | ( | ... | ) |
Function: xbmc.playSFX(filename,[useCached])
Plays a wav file by filename
filename | string - filename of the wav file to play |
useCached | [opt] bool - False = Dump any previously cached wav associated with filename |
Example:
restart | ( | ) |
Function: xbmc.restart()
Restart the htpc.
Example:
shutdown | ( | ) |
Function: xbmc.Shutdown()
Shutdown the htpc.
Example:
skinHasImage | ( | ... | ) |
Function: xbmc.skinHasImage(image)
Check skin for presence of Image.
image | string - image filename |
Example:
sleep | ( | ... | ) |
Function: xbmc.sleep(time)
Sleeps for 'time' msec.
time | integer - number of msec to sleep. |
PyExc_TypeError | If time is not an integer. |
Example:
startServer | ( | ... | ) |
Function: xbmc.startServer(typ, bStart, bWait)
Start or stop a server.
typ | integer - use SERVER_* constants
| ||||||||||||||||
bStart | bool - start (True) or stop (False) a server | ||||||||||||||||
bWait | [opt] bool - wait on stop before returning (not supported by all servers) |
Example:
stopSFX | ( | ) |
Function: xbmc.stopSFX()
Stops wav file
Example:
translatePath | ( | ... | ) |
Function: xbmc.translatePath(path)
Returns the translated path.
path | string or unicode - Path to format |
Example:
validatePath | ( | ... | ) |
Function: xbmc.validatePath(path)
Returns the validated path.
path | string or unicode - Path to format |
Example: