Script sources

From Official Kodi Wiki
Jump to navigation Jump to search
Home icon grey.png   ▶ Development ▶ Add-on development ▶ About Add-ons ▶ Script sources

1 What Kodi requires for your add-on

For Kodi to know what to do with your addon, we require your script, and an addon.xml file. The layout of the XML describing this extension point is as follows:

See add-ons for Kodi for more information on addon.xml, including how you add descriptions to your addon for users. A script extends Kodi via the xbmc.python.script extension point.

<extension point="xbmc.python.script"
             library="" />

list of extension points and their explanation:

  "xbmc.python.script"          This is the standard Script extension point

below listed extensions will not appear in the Addons/Programs window and can only be run via skin shortcuts

  ""        Used for weather scripts
  "xbmc.python.subtitles"      Used for subtitle scripts
  "xbmc.python.lyrics"         Used for lyrics scripts
  "xbmc.python.library"        Used for skin dependent scripts (e.g. recently added script)

Example of "xbmc.python.script":

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.globalsearch" name="Global Search" version="9.0.5" provider-name="ronie">
		<import addon="xbmc.python" version="3.0.0"/>
	<extension point="xbmc.python.script" library=""/>
	<extension point="xbmc.addon.metadata">
		<summary lang="en_GB">Search your library.</summary>
		<description lang="en_GB">This addon can find any item in your video and music library.</description>
		<news>- add support for searching musicvideos by artist name</news>

2 Interacting with Kodi

Given that your script can return information to the user, you may wish to allow some (or all) of the information you provide to be translatable. You do this by providing a strings.po file (in resources/language/<name_of_language>/strings.po) which associates integer id's with each label. Kodi then handles loading these string files and ensuring that the users' locale information is taken into account. To display strings you use the getString function in the Xbmcaddon_module.

3 See also