Addon.xml: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
 
(25 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{mininav|[[Development]]|[[Add-on development]]}}
{{Mininav|[[Development]]|[[Add-on development]]}}
{{TOC right}}
<div class="noautonum toclimit-7" style="background: none; clear: right; float: right; margin-bottom: 0.5em; padding: 0.5em 0 0.8em 1.4em; width: auto;">__TOC__</div>
<br />


Every skin, script, or plugin in Kodi contains an <code>addon.xml</code> file which describes the add-on, providing credits, version information and dependencies. Below, we will explain how this file is structured and which elements must be used to create an add-on for Kodi. You can also consult the examples at the end to see how this file is laid out depending on if you are developing a skin or script.
Every skin, script, or plugin in Kodi contains an <code>addon.xml</code> file which describes the add-on, providing credits, version information and dependencies. Below, we will explain how this file is structured and which elements must be used to create an add-on for Kodi. You can also consult the examples at the end to see how this file is laid out depending on if you are developing a skin or script.


Every <code>addon.xml</code> file has the same basic structure, this example is for a video plugin:
Every <samp>addon.xml</samp> file has the same basic structure, this example is for a video plugin:
 
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml" enclose="div">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You">
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You">
   <requires>
   <requires>
     <import addon="xbmc.python" version="2.25.0"/>
     <import addon="xbmc.python" version="2.25.0" />
   </requires>
   </requires>
   <extension point="xbmc.python.pluginsource" library="addon.py">
   <extension point="xbmc.python.pluginsource" library="addon.py">
Line 20: Line 18:
     <description lang="en_GB">Your add-on's description</description>
     <description lang="en_GB">Your add-on's description</description>
     <disclaimer lang="en_GB"></disclaimer>
     <disclaimer lang="en_GB"></disclaimer>
     <language>en</language> <!-- the language of the videos or other content the plugin provides, may be omitted in case the addon does not provide any content -->
     <language>en</language> <!-- language of the content the add-on provides, omit if the add-on does not provide any content -->
     <platform>all</platform>
     <platform>all</platform>
     <license>GPL-2.0</license>
     <license>GPL-2.0-or-later</license>
     <forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be omitted -->
     <forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be omitted -->
     <website>http://myplugin.com</website> <!-- the url of the website that contains the videos (or the official website of your plugin). May be omitted. -->
     <website>http://myplugin.com</website> <!-- URL of the website that supplies the content, or the website for your plugin; may be omitted. -->
     <email>[email protected]</email> <!-- may be left omitted -->
     <email>[email protected]</email> <!-- may be omitted -->
     <source>http://github.com/you/plugin.addon.id</source>
     <source>http://github.com/you/plugin.addon.id</source>
     <news>v1.2.3 (01/02/201x)
     <news>v1.2.3 (01/02/2013)
       [new] some new feature
       [new] some new feature
       [fix] some fix
       [fix] some fix
Line 34: Line 32:
         <icon>resources/icon.png</icon>
         <icon>resources/icon.png</icon>
         <fanart>resources/fanart.jpg</fanart>
         <fanart>resources/fanart.jpg</fanart>
         <banner></banner>
         <banner></banner> <!-- optional -->
         <clearlogo>resources/clearlogo.png</clearlogo>
         <clearlogo>resources/clearlogo.png</clearlogo> <!-- optional -->
         <screenshot></screenshot>
         <screenshot></screenshot> <!-- optional, max. 10 -->
     </assets>
     </assets>
   </extension>
   </extension>
Line 43: Line 41:


There are a few important things to note in the above sample:
There are a few important things to note in the above sample:
* The <syntaxhighlight lang="xml" inline><addon></syntaxhighlight> element must be present, and be the root node. It presents data about the add-on package as a whole. Inside it should be:
** A <syntaxhighlight lang="xml" inline><requires></syntaxhighlight> element, listing all the dependencies that this add-on needs in order to function inside individual <syntaxhighlight lang="xml" inline><import></syntaxhighlight> elements for each one.
** One or more <syntaxhighlight lang="xml" inline><extension></syntaxhighlight> elements, each of which describes a part of Kodi that the add-on extends.
*** Finally, there is a specific extension element, <syntaxhighlight lang="xml" inline><extension point="xbmc.addon.metadata"></syntaxhighlight> that describes the add-on to the user.
**** Image assets such as icons, a banner and screenshots declared inside their own named elements inside of an <syntaxhighlight lang="xml" inline><assets></syntaxhighlight> tag (exclusive to Kodi v18+)


* The <code><addon></code> element must be present, and be the root node. It presents data about the add-on package as a whole.
== Core elements ==
* Inside the <code><addon></code> element is a <code><requires></code> element, listing all the dependencies that this add-on needs in order to function.
=== <addon> ===
* Then there are one or more <code><extension></code> elements, each of which describes a part of Kodi that the add-on extends.
The <syntaxhighlight lang="xml" inline><addon></syntaxhighlight> element has 4 attributes, and they are all required: <code>id</code>, <code>version</code>, <code>name</code>, and <code>provider-name</code>.  
* Finally, there is a specific <code><extension></code> element that extends <code>"xbmc.addon.metadata"</code>. This describes the add-on to the user.
* Banners and clearlogos assets exclusive to Kodi v.18+
= Elements =
== <addon> ==
 
The <code><addon></code> element has 4 attributes, all required: <code>id</code>, <code>version</code>, <code>name</code>, and <code>provider-name</code>. For example:
 
<source lang="xml">
<addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2">
</source>
 
=== id attribute ===


The id attribute is the unique identifier used for this add-on. It must be unique, and must use only lowercase characters, periods, underscores, dashes and numbers. This identifier is also used as the name of the folder that contains the add-on, so for ease of searching, we suggest you use something like <type>.<uniquename>.
''Example'': <syntaxhighlight lang="xml" inline><addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2"></syntaxhighlight>


=== version attribute ===
==== id attribute ====
The id attribute is the unique identifier used for this add-on.  It must be unique, and must use only lowercase characters, periods, underscores, dashes and numbers.  This identifier is also used as the name of the folder that contains the add-on, so for ease of searching, we suggest you use something like <code><var>type</var>.<var>uniquename</var></code>.


==== version attribute ====
The version attribute is used by Kodi to determine whether updates are available. This should be use a version scheme like <code>x.y.z</code> (major.minor.patch). For example: <code>version="0.0.1"</code>. Generally, you'll start with a version of <code>0.y.z</code> for test releases and once you feel it is ready for a full release, you'd bump the version to <code>1.0.0</code>.
The version attribute is used by Kodi to determine whether updates are available. This should be use a version scheme like <code>x.y.z</code> (major.minor.patch). For example: <code>version="0.0.1"</code>. Generally, you'll start with a version of <code>0.y.z</code> for test releases and once you feel it is ready for a full release, you'd bump the version to <code>1.0.0</code>.


==== How versioning works ====
===== How versioning works =====
 
* <code>2.2.9</code> is newer than <code>2.2.1</code>
* <code>2.2.9</code> is newer than <code>2.2.1</code>
* <code>2.2.10</code>   is newer than <code>2.2.1</code>
* <code>2.2.10</code> is newer than <code>2.2.1</code>
* <code>2.3.0</code>   is newer than <code>2.2.9</code>
* <code>2.3.0</code> is newer than <code>2.2.9</code>
* <code>2.2.1</code> is newer than <code>2.2.1~alpha</code>
* <code>2.2.1</code> is newer than <code>2.2.1~alpha</code>
* <code>2.2.1</code> is newer than <code>2.2.1~beta</code>
* <code>2.2.1</code> is newer than <code>2.2.1~beta</code>
Line 78: Line 69:
* <code>2.2.1~beta10</code> is newer than <code>2.2.1~beta1</code>
* <code>2.2.1~beta10</code> is newer than <code>2.2.1~beta1</code>


{{tip|Text should only be added for a beta version. In other cases version number should only contain numbers.}}
{{Tip|Text should only be added for a beta version. In other cases version number should only contain numbers.}}
 
=== name attribute ===
 
The name attribute is the name of the add-on as it appears in the UI.  This should be in English where it makes sense for it to be so, and is not translatable.


=== provider-name attribute ===
==== name attribute ====
The name attribute is the name of the add-on as it appears in the UI. This should be in English where it makes sense for it to be so, and is not translatable.


==== provider-name attribute ====
The provider-name attribute is used as the author field.  This could be a team of authors or a single author. If the add-on is maintained by multiple people please separate them with a comma (<code>,</code>).
The provider-name attribute is used as the author field.  This could be a team of authors or a single author. If the add-on is maintained by multiple people please separate them with a comma (<code>,</code>).


== <requires> ==
=== <requires> ===
 
The <syntaxhighlight lang="xml" inline><requires></syntaxhighlight> element contains one or more <syntaxhighlight lang="xml" inline><import></syntaxhighlight> elements which specify which other add-ons this particular add-on requires, and which version of those add-ons it requires. These add-ons may be part of Kodi itself, or may be parts of other third-party add-ons.
The <code><requires></code> element contains one or more <code><import></code> elements which specify which other add-ons this particular add-on requires, and which version of those add-ons it requires. These add-ons may be part of Kodi itself, or may be parts of other third-party add-ons.


Kodi will only allow the add-on to be run if suitable versions of the (non-optional) add-ons on which this add-on depends are installed. When a user installs your add-on from an online repository via Kodi's add-on manager, Kodi attempts to resolve these dependencies, and install anything that your add-on relies on first. The dependency must be provided with the minimum version number your script/skin requires.
Kodi will only allow the add-on to be run if suitable versions of the (non-optional) add-ons on which this add-on depends are installed. When a user installs your add-on from an online repository via Kodi's add-on manager, Kodi attempts to resolve these dependencies, and install anything that your add-on relies on first. The dependency must be provided with the minimum version number your script/skin requires.


=== Examples ===
''Examples'':
 
Here is a sample <syntaxhighlight lang="xml" inline><requires></syntaxhighlight> block that imports two required modules:
Here is a sample <code><requires></code> block that imports two required modules:
<syntaxhighlight lang="xml">
 
<source lang="xml">
<requires>
<requires>
   <import addon="xbmc.python"                 version="2.25.0"/>
   <import addon="xbmc.python"               version="2.25.0" />
   <import addon="script.module.elementtree"   version="1.2.7"/>
   <import addon="script.module.elementtree" version="1.2.7" />
</requires>
</requires>
</source>
</syntaxhighlight>


Here's another example, which will only install on LibreELEC. This occurs because the addon will depend on an addon that only exists in LibreELEC. Hence, Kodi will refuse to install the addon in other platforms due to unmet dependencies:
Here's another example, which will only install on LibreELEC. This occurs because the addon will depend on an addon that only exists in LibreELEC. Hence, Kodi will refuse to install the addon in other platforms due to unmet dependencies:
 
<syntaxhighlight lang="xml">
<source lang="xml">
<requires>
<requires>
   <import addon="os.librelec.tv" version="2.0"/>
   <import addon="os.librelec.tv" version="2.0" />
</requires>
</requires>
</source>
</syntaxhighlight>
 
== <import> ==
 
Each <code><import></code> element describes one dependency for an add-on, with two required attributes: <code>addon</code> and <code>version</code>. There is also an optional attribute called, fittingly, <code>optional</code>.


If your add-on relies on other third-party add-ons, Kodi will automatically install them as well, provided they are available on an existing add-on repository. If they aren't available on any existing repository, the user must install the other add-ons themselves. Note that you need to include any Python libraries you need directly in your add-on; these can't be loaded with an <code><import></code> element, since Kodi wouldn't know what to do with them.
==== <import> ====
Each <syntaxhighlight lang="xml" inline><import></syntaxhighlight> element describes one dependency for an add-on, with two required attributes: <code>addon</code> and <code>version</code>. There is also an optional attribute called, fittingly, <code>optional</code>.


=== addon attribute ===
If your add-on relies on other third-party add-ons, Kodi will automatically install them as well, provided they are available on an existing add-on repository. If they aren't available on any existing repository, the user must install the other add-ons themselves. Note that you need to include any Python libraries you need directly in your add-on; these can't be loaded with an <syntaxhighlight lang="xml" inline><import></syntaxhighlight> element, since Kodi wouldn't know what to do with them.


===== addon attribute =====
The <code>addon</code> attribute specifies the id of the required add-on, e.g. <code>script.module.elementtree</code>.
The <code>addon</code> attribute specifies the id of the required add-on, e.g. <code>script.module.elementtree</code>.


=== version attribute ===
===== version attribute =====
 
The <code>version</code> attribute specifies the minimum version of the required add-on to be installed.
The <code>version</code> attribute specifies the minimum version of the required add-on to be installed.


==== Dependency versions ====
====== Dependency versions ======
 
Each different Kodi version might require you to use a higher version of the <code>xbmc.*</code> add-on dependencies to control on which version of Kodi the add-on can be installed.
Each different Kodi version might require you to use a higher version of the <code>xbmc.*</code> add-on dependencies to control on which version of Kodi the add-on can be installed.
 
{| role="presentation" class="wikitable" style="border: 1px solid #000; border-collapse: collapse;"
{| class="prettytable" border="1"
|+ Current versions
|+ Current versions
! scope="col" | Kodi version
! Kodi version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon
! scope="col" | xbmc.python
|-
! scope="col" | xbmc.gui
| Dharma 10.1 <font color="red">Deprecated</font>|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1
! scope="col" | xbmc.json
|-
! scope="col" | xbmc.metadata
| Eden 11.0 <font color="red">Deprecated</font> || 2.0 || 3.0 || 4.0 || 1.0 || 11.0
! scope="col" | xbmc.addon
|-
|-
| Frodo 12.x <font color="red">Deprecated</font>|| 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0
! scope="row" | [[Archive:Dharma Guide|Dharma 10.1]] {{Red|Deprecated}}
|-
| 1.0 || 2.11 || 2.0|| 1.0 || 0.1
| Gotham 13.x || 2.14.0 (ABI 2.1.0) || 5.0.1 || 6.6.0 (ABI 6.0.0) || 2.1.0 || 13.0.0 (ABI 12.0.0)
|-
|-
! scope="row" | [[Archive:Eden API changes|Eden 11.0]] {{Red|Deprecated}}
| Helix 14.x || 2.19.0 (ABI 2.1.0) || 5.3.0 || 6.20.0 (ABI 6.0.0) || 2.1.0 || 14.0.0 (ABI 12.0.0)
| 2.0 || 3.0 || 4.0 || 1.0 || 11.0
|-
|-
| Isengard 15.x || 2.20.0 (ABI 2.1.0) || 5.9.0 (ABI 5.3.0) || 6.25.1 (ABI 6.0.0) || 2.1.0 || 15.0.0 (ABI 12.0.0)
! scope="row" | [[Frodo|Frodo 12.x]] {{Red|Deprecated}}
|-
| 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0
| Jarvis 16.x || 2.24.0 (ABI 2.1.0) || 5.10.0 || 6.32.4 (ABI 6.0.0) || 2.1.0 || 16.0.0 (ABI 12.0.0)
|-
|-
! scope="row" | [[Archive:Gotham API changes|Gotham 13.x]]
| Krypton 17.x || 2.25.0 (ABI 2.1.0) || 5.12.0 || 7.0.0 (ABI 6.0.0) || 2.1.0 || 17.0.0 (ABI 12.0.0)
| 2.14.0 (ABI 2.1.0) || 5.0.1 || 6.6.0 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 13.0.0 (ABI 12.0.0)
|-
|-
| Leia 18.x || 2.26.0 (ABI 2.1.0) || 5.14.0 || 9.7.2 (ABI 6.0.0) || 2.1.0 || 17.9.910 (ABI 12.0.0)
! scope="row" | [[Archive:Helix|Helix 14.x]]
|-
| 2.19.0 (ABI 2.1.0) || 5.3.0 || 6.20.0 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 14.0.0 (ABI 12.0.0)
| Leia 19.x || 3.0.0 (ABI 3.0.0) || 5.14.0 || 11.2.0 (ABI 6.0.0) || 2.1.0 || 18.9.701 (ABI 12.0.0)
|-
! scope="row" | [[Archive:Isengard|Isengard 15.x]]
| 2.20.0 (ABI 2.1.0) || 5.9.0 (ABI 5.3.0) || 6.25.1 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 15.0.0 (ABI 12.0.0)
|-
! scope="row" | [[Archive:Jarvis|Jarvis 16.x]]
| 2.24.0 (ABI 2.1.0) || 5.10.0 || 6.32.4 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 16.0.0 (ABI 12.0.0)
|-
! scope="row" | [[Archive:Krypton|Krypton 17.x]]
| 2.25.0 (ABI 2.1.0) || 5.12.0 || 7.0.0 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 17.0.0 (ABI 12.0.0)
|-
! scope="row" | [[Leia|Leia 18.x]]
| 2.26.0 (ABI 2.1.0) || 5.14.0 || 9.7.2 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 17.9.910 (ABI 12.0.0)
|-
! scope="row" | [[Matrix|Matrix 19.x]]
| 3.0.0 (ABI 3.0.0) || 5.15.0 (ABI 5.14.0) || 11.2.0 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 19.1.0 (ABI 12.0.0)
|-
! scope="row" | [[Nexus|Nexus 20.x]]
| 3.0.1 (ABI 3.0.0) || 5.16.0 (ABI 5.15.0) || 13.0.0 (ABI 6.0.0) || 2.1.0 (ABI 1.0) || 20.90.101 (ABI 12.0.0)
|}
|}


Each Kodi version contain a certain backwards compatibility. For example add-ons made for Gotham 13.x can still work ion Jarvis 16.x. Do note that this might change in the future. The '''ABI''' version you see in the table above is the backwards compatibility version for which add-ons are still marked "working".
Each Kodi version contain a certain backwards compatibility. For example add-ons made for Gotham 13.x can still work on Leia 18.x. Same happens for Matrix and Nexus addons. Do note that this might change in the future. The '''ABI''' version you see in the table above is the backwards compatibility version for which add-ons are still marked "working".
 
=== optional attribute ===


===== optional attribute =====
The dependency may be made optional by setting the <code>optional</code> attribute to <code>true</code>. This will only install the dependency when the add-on actually needs it. Even if this dependency is missing, the add-on can still be installed.
The dependency may be made optional by setting the <code>optional</code> attribute to <code>true</code>. This will only install the dependency when the add-on actually needs it. Even if this dependency is missing, the add-on can still be installed.


== <extension> ==
=== <extension> ===
 
The <syntaxhighlight lang="xml" inline><extension></syntaxhighlight> element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of Kodi that the add-on extends. For instance, the <code>addon.xml</code> file for the Confluence skin extends the <code>xbmc.gui.skin</code> part of xbmc. All available extension points are given below.
The <code><extension></code> element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of Kodi that the add-on extends. For instance, the <code>addon.xml</code> file for the Confluence skin extends the <code>xbmc.gui.skin</code> part of xbmc. All available extension points are given below.


==== point attribute ====
The various extension points that Kodi provides are given in the list below.
The various extension points that Kodi provides are given in the list below.
{| class="prettytable"
{| role="presentation" class="wikitable"
!Extension point
! scope="col" | Extension point
!Add-on Category
! scope="col" | Type declaration
|-
|-
|<code>[[Skinning|xbmc.gui.skin]]</code>
! scope="row" | <code>kodi.resource.font</code>
|Skin
| [[Fonts|Additional fonts]]
|-
|-
|<code>xbmc.webinterface</code>
! scope="row" | <code>kodi.resource.images</code>
|Web interface
| Additional image files
|-
|-
|<code>[[Add-on repositories|xbmc.addon.repository]]</code>
! scope="row" | <code>kodi.resource.language</code>
|''None''
| [[Language support|Additional languages]]
|-
|-
|<code>[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]</code>
! scope="row" | <code>kodi.resource.uisounds</code>
|Services
| [[UI sounds add-ons|Additional UI event sounds]]
|-
|-
|<code>xbmc.metadata.scraper.albums</code>
! scope="row" | <code>[[:Category:Music add-ons|xbmc.addon.audio]]</code>
|Album information
| [[:Category:Music add-ons|Music add-ons]] <small>(audio)</small>
|-
|-
|<code>xbmc.metadata.scraper.artists</code>
! scope="row" | <code>[[:Category:Picture add-ons|xbmc.addon.image]]</code>
|Artist information
| [[:Category:Picture add-ons|Picture add-ons]] <small>(images)</small>
|-
|-
|<code>xbmc.metadata.scraper.movies</code>
! scope="row" | <code>[[Add-on repositories|xbmc.addon.repository]]</code>
|Movie information
| [[Unofficial repositories]]
|-
|-
|<code>xbmc.metadata.scraper.musicvideos</code>
! scope="row" | <code>[[:Category:Video add-ons|xbmc.addon.video]]</code>
|Music video information
| [[:Category:Video add-ons|Video add-ons]] <small>(video)</small>
|-
|-
|<code>xbmc.metadata.scraper.tvshows</code>
! scope="row" | <code>[[Skinning|xbmc.gui.skin]]</code>
|TV information
| [[Skins]]
|-
|-
|<code>xbmc.metadata.scraper.library</code>
! scope="row" | <code>[[:Category:Album scraper add-ons|xbmc.metadata.scraper.albums]]</code>
|''None''
| [[Scraping Music#Albums|Album information]]
|-
|-
|<code>xbmc.ui.screensaver</code>
! scope="row" | <code>[[:Category:Artist scraper add-ons|xbmc.metadata.scraper.artists]]</code>
|Screensaver
| [[Scraping Music#Artists|Artist information]]
|-
|-
|<code>xbmc.player.musicviz</code>
! scope="row" | <code>[[:Category:Scraper|xbmc.metadata.scraper.library]]</code>
|Visualization
| [[Scrapers]]
|-
|-
|<code>[[Plugin sources#What Kodi requires for your add-on|xbmc.python.pluginsource]]</code>
! scope="row" | <code>[[:Category:Movie scraper add-ons|xbmc.metadata.scraper.movies]]</code>
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)
| Movie information
|-
|-
|<code>[[Script sources#What Kodi requires for your add-on|xbmc.python.script]]</code>
! scope="row" | <code>[[:Category:Music video scraper add-ons|xbmc.metadata.scraper.musicvideos]]</code>
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)
| [[Music videos|Music video information]]
|-
|-
|<code>xbmc.python.weather</code>
! scope="row" | <code>[[:Category:TV scraper add-ons|xbmc.metadata.scraper.tvshows]]</code>
|Weather
| [[TV Shows|TV show information]]
|-
|-
|<code>xbmc.subtitle.module</code>
! scope="row" | <code>[[:Category:Music visualization add-ons|xbmc.player.musicviz]]</code>
|Subtitle service module
| Music visualization
|-
|-
|<code>[[Script lyrics#What Kodi requires for your add-on|xbmc.python.lyrics]]</code>
! scope="row" | <code>[[:Category:Add-on libraries/modules|xbmc.python.library]]</code>
|Lyrics
| [[Python libraries]] {{Note|These don't show up in the add-on browser and are purely to satisfy dependencies.}}
|-
|-
|<code>[[Script library#What Kodi requires for your add-on|xbmc.python.library]]</code>
! scope="row" | <code>[[:Category:Lyrics add-ons|xbmc.python.lyrics]]</code>
|These don't show up in the addon browser and are purely as support for other scripts.
| [[Script lyrics|Lyrics]]
|-
|-
|<code>xbmc.python.module</code>
! scope="row" | <code>[[:Category:Add-on libraries/modules|xbmc.python.module]]</code>
|Provides an additional python library. mainly for use in script.module.* addons.
| [[Python development|Additional python library]], mainly for use by script.module add-ons.
|-
|-
|<code>xbmc.addon.video</code>
! scope="row" | <code>[[Plugin sources|xbmc.python.pluginsource]]</code>
|Video Add-ons (video)
| rowspan="2" | [[:Category:Music add-ons|Music add-ons]] <small>(audio)</small> / [[:Category:Picture add-ons|Picture add-ons]] <small>(images)</small> / [[:Category:Program add-ons|Program add-ons]] <small>(executables)</small> / [[:Category:Video add-ons|Video add-ons]] <small>(video)</small>
|-
|-
|<code>xbmc.addon.audio</code>
! scope="row" | <code>[[Script sources|xbmc.python.script]]</code>
|Music Add-ons (audio)
|-
|-
! scope="row" | <code>[[Weather addons|xbmc.python.weather]]</code>
|<code>xbmc.addon.image</code>
| [[Weather]]
|Picture Add-ons (image)
|-
|-
! scope="row" | <code>[[Service add-ons|xbmc.service]]</code>
|<code>kodi.resource.images</code>
| [[Service add-ons|Services]]
|Additional image files
|-
|-
! scope="row" | <code>[[:Category:Subtitle add-ons|xbmc.subtitle.module]]</code>
|<code>kodi.resource.language</code>
| [[Subtitles|Subtitle source]]
|Additional language files
|-
! scope="row" | <code>[[:Category:Screensaver add-ons|xbmc.ui.screensaver]]</code>
| [[HOW-TO:Screensaver addon|Screensaver]]
|-
! scope="row" | <code>[[Web interface|xbmc.webinterface]]</code>
| [[Web interface]]
|}
|}
Add-ons that don't correspond to a specific add-on category can not be installed by users. These are usually supporting or shared add-ons that are installed automatically by the add-ons that require them.
Add-ons that don't correspond to a specific add-on category can not be installed by users. These are usually supporting or shared add-ons that are installed automatically by the add-ons that require them.


=== xbmc.python.pluginsource ===
===== xbmc.python.pluginsource =====
{{See also|Plugin sources}}
{{See also|Plugin sources}}
The most common extension point that will be used by plugin addon developers is <code>xbmc.python.pluginsource</code>.
The most common extension point that will be used by plugin addon developers is <code>xbmc.python.pluginsource</code>.


==== library attribute ====
====== library attribute ======
 
The <syntaxhighlight lang="xml" inline><extension point="xbmc.python.pluginsource"></syntaxhighlight> element has an extra attribute: <code>library</code>. This is the name of the Python script (startup script) that will be run when the add-on is activated. This file must exist in the root of your add-on directory.
The <code><extension point="xbmc.python.pluginsource"></code> element has an extra attribute: <code>library</code>. This is the name of the Python script (startup script) that will be run when the add-on is activated. This file must exist in the root of your add-on directory.


==== <provides> element ====
====== <provides> element ======
 
The extension has an additional child element named <syntaxhighlight lang="xml" inline><provides></syntaxhighlight>, which contains a whitespace separated list of <code>audio</code>, <code>executable</code>, <code>image</code> and/or <code>video</code>. This determines in what area (or context) of the Kodi system your addon will make itself visible in (please note that this applies only to <kbd>pluginsource</kbd> extension points):
The extension has an additional child element named <code><provides></code>, which contains a whitespace separated list of <code>image</code>, <code>video</code>, <code>audio</code>, and/or <code>executable</code>. This determines in what area (or context) of the Kodi system your addon will make itself visible in (please note that this applies only to plugin extension points):
{| role="presentation" class="wikitable" style="padding: 0.5em 1em;"
 
! scope="col" | Provides
{| class="prettytable"
! scope="col" | Appears in
!Provides
|-
!Appears in
| <code>image</code>
|-
| Pictures
|<code>image</code>
|-
|Pictures
| <code>audio</code>
|-
| Music
|<code>audio</code>
|-
|Music
| <code>video</code>
|-
| Video
|<code>video</code>
|-
|Video
| <code>executable</code>
|-
| Programs
|<code>executable</code>
|-
|Programs
| ''(blank)''
|-
| See Note below
|''(blank)''
|Not visible
|}
|}
{{Note|If the <syntaxhighlight lang="xml" inline><provides></syntaxhighlight> element is not defined, behavior will depend on the structure of your add-on. If it has a single extension point (e.g. a single '''<code>xbmc.python.script</code>''' or '''<code>xbmc.python.pluginsource</code>'''), {{Kodi}} will default to <code>executable</code> (thus your add-on will be shown in Programs). If your add-on has multiple extension points and none specifies a <syntaxhighlight lang="xml" inline><provides></syntaxhighlight> element, different entries for your add-on will be shown in "Programs" (multiple fallbacks to "executable"). If your add-on has multiple extension points and only one (or some) define the <syntaxhighlight lang="xml" inline><provides></syntaxhighlight> tag it really depends on the order of the extension points. If the first extension point (your add-on's '''main extension point''') defines the <syntaxhighlight lang="xml" inline><provides></syntaxhighlight> element, {{Kodi}} will assume all the other (empty) extension points provide the same content. Otherwise, it will set the content for all the extension points that specify the <syntaxhighlight lang="xml" inline><provides></syntaxhighlight> tag and fallback all the others to "executable". '''At the moment, there is no way to hide an add-on from the interface.'''|Reminder}}


==== Example ====
''Example'':
 
<syntaxhighlight lang="xml">
<source lang="xml">
<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py">
<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py">
   <provides>audio video</provides>
   <provides>audio video</provides>
</extension>
</extension>
</source>
</syntaxhighlight>


=== xbmc.addon.metadata ===
===== xbmc.addon.metadata =====
This special extension point ''must'' be provided by all add-ons, and is the way that your add-on is described to users of the Kodi add-on manager. There are several elements that this should contain. Most of these elements are required (except the deprecated tag). However, in case the elements do not apply (e.g. language, website, email) they can be omitted from the addon.xml file.


This special extension point ''must'' be provided by all add-ons, and is the way that your add-on is described to users of the Kodi add-on manager.
====== Localization ======
Language specific elements must always be present in English as a minimum. Many of these elements can be translated into multiple languages and should be added once for each supported language. The <code>lang</code> attribute should contain a [[wikipedia:Locale (computer software)|locale identifier]]. If omitted, it defaults to en_GB.
{{Note|Kodi v14 and older uses ISO-639 code. See [[List of language codes (ISO-639:1988)]]}}


==== Available elements ====
====== <summary> ======
One or more <syntaxhighlight lang="xml" inline><summary></syntaxhighlight> elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.


There are several elements that this should contain. Most of these elements are required (except the broken tag). However, in case the elements do not apply (e.g. language, website, email) they can be omitted from the addon.xml file. Language specific elements must always be present in English as a minimum.
''Example'': <syntaxhighlight lang="xml" inline><summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary></syntaxhighlight>


Many of these elements can be translated into multiple languages and should be added once for each supported language. The <code>lang</code> attribute should contain a [https://en.wikipedia.org/wiki/Locale_(computer_software) locale identifier]. If omitted, it defaults to en_GB. (Note: Kodi v14 and older uses ISO-639 code. See [[List of language codes (ISO-639:1988)]]).
====== <description> ======
One or more <syntaxhighlight lang="xml" inline><description></syntaxhighlight> elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.


===== <summary> =====
''Example'':
 
<syntaxhighlight lang="xml">
One or more <code><summary></code> elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.
<description lang="en_GB">Hello World script provides some basic examples on how to create your first script and hopefully will increase the number of Kodi users to start creating their own addons.</description>
 
</syntaxhighlight>
<source lang="xml">
<summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary>
</source>
 
===== <description> =====
 
One or more <code><description></code> elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.
 
<source lang="xml">
<description lang="en_GB">Hello World script provides some basic examples on how to create your first script
and hopefully will increase the number of Kodi users to start creating their own addons.</description>
</source>
 
===== <disclaimer> =====
 
One or more <code><disclaimer></code> elements that indicate what (if any) things the user should know about the add-on. There is no need to have a disclaimer if you don't want one, though if something requires settings, or only works in a particular country then you may want to state this here. It may be translated into multiple languages.
 
<source lang="xml">
<disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer>
</source>


===== <news> =====
====== <disclaimer> ======
One or more <syntaxhighlight lang="xml" inline><disclaimer></syntaxhighlight> elements that indicate what (if any) things the user should know about the add-on. There is no need to have a disclaimer if you don't want one, though if something requires settings, or only works in a particular country then you may want to state this here. It may be translated into multiple languages.


{{note|Used in Kodi v17 Krypton and later only. Older versions are forward compatible.}}
''Example'': <syntaxhighlight lang="xml" inline><disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer></syntaxhighlight>


The <code><news></code> element should contains a simple description of the major changes made to the add-on (new functionality, big fixes, etc). This is displayed in the Kodi addon installation/update system. (In the author's opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that they may have been having has been fixed or not.)
====== <news> ======
Please keep it short (it's limited to 1500 characters), you might want to only include the changes for the last version here.
{{Note|Used in Kodi v17 Krypton and later only. Older versions are forward compatible.}}


Here is an example:
The <syntaxhighlight lang="xml" inline><news></syntaxhighlight> element should contains a simple description of the major changes made to the add-on (new functionality, big fixes, etc). This is displayed in the Kodi addon installation/update system. (In the author's opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that they may have been having has been fixed or not.)
Please keep it short (it's limited to 1500 characters); you might want to only include the changes for the last version here.


<source lang="xml">
Here is an example:
<news>v0.1.2  (2014-1-15)
<syntaxhighlight lang="xml">
<news>v0.1.2  (2014-01-15)
- Added notification for Ubuntu users checking through apt command</news>
- Added notification for Ubuntu users checking through apt command</news>
</source>
</syntaxhighlight>
 
===== <platform> =====
 
The <code><platform></code> tag specifies which platforms (operating systems, hardware, architecture) this add-on runs on. Many add-ons will run on all platforms, so <code>all</code> is an option. If the platform tag is missing, we assume the add-on runs on all platforms. A combination of these is also possible. Currently available options are:


====== <platform> ======
The <syntaxhighlight lang="xml" inline><platform></syntaxhighlight> tag specifies which platforms (operating systems, hardware, architecture) this add-on runs on. Many add-ons will run on all platforms, so <code>all</code> is an option. If the platform tag is missing, we assume the add-on runs on all platforms. A space-delimited combination of these is also possible. Currently available options are:
* <code>all</code>
* <code>all</code>
* <code>linux</code>
* <code>linux</code>
Line 360: Line 343:
* <code>android-i686</code>
* <code>android-i686</code>


<source lang="xml">
{{Note|Kodi v19 Matrix and later.}}
<platform>all</platform>
 
</source>
* <code>tvos</code>
* <code>tvos-aarch64</code>
 
''Example'': <syntaxhighlight lang="xml" inline><platform>linux osx-x86_64 windows-x86_64</platform></syntaxhighlight>
 
====== <language> ======
The <syntaxhighlight lang="xml" inline><language></syntaxhighlight> elements indicate the language(s) of the ''content'' provided by your add-on. It applies to plugins, scripts, scrapers, etc. This allows browsing the add-on list by language. When there is no specific language provided in your content, omit it from the addon.xml.


===== <language> =====
''Example'': <syntaxhighlight lang="xml" inline><language>en de fr</language></syntaxhighlight>


The <code><language></code> elements indicate the language(s) of the ''content'' provided by your add-on. It applies to plugins, scripts, scrapers etc. This allows browsing the add-on list by language. When there is no specific language provided in your content, omit it from the addon.xml.
====== <license> ======
The <syntaxhighlight lang="xml" inline><license></syntaxhighlight> element indicates what license is used for this add-on. In general, the [https://spdx.dev/ids/ SPDX License Expression] for the license(s) are preferable to the full license name:


<source lang="xml">
''Examples'':<br />
<language>en de fr</language>
SPDX License Expression: <syntaxhighlight lang="xml" inline><license>GPL-2.0-or-later</license></syntaxhighlight>
</source>
<br />vs<br />
Full license name: <syntaxhighlight lang="xml" inline><license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license></syntaxhighlight>


===== <license> =====
If your add-on includes multiple licenses:
* Separate license names using <code>|</code> (the pipe or vertical bar character) when there is a choice between licenses:
** <syntaxhighlight lang="xml" inline><license>GPL-2.0-or-later | LGPL-2.0-or-later</license></syntaxhighlight>
* Separate license names using <code>&</code> (ampersand), or <code>,</code> (comma), when multiple licenses exist that cover different parts of the source.
** <syntaxhighlight lang="xml" inline><license>GPL-2.0-or-later & MIT</license></syntaxhighlight>
** <syntaxhighlight lang="xml" inline><license>GPL-2.0-or-later, MIT</license></syntaxhighlight>


The <code><license></code> element indicates what license is used for this add-on. In general, the SPDX identifier for the license is advised when compared to the full license name:
====== <forum> ======
The <syntaxhighlight lang="xml" inline><forum></syntaxhighlight> element provides the forum thread URL for this specific add-on. Omit this element if there is no forum thread.


<source lang="xml">
''Example'': <syntaxhighlight lang="xml" inline><forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum></syntaxhighlight>
<license>GPL-2.0</license> <!-- SPDX identifier -->
</source>


vs
====== <website> ======
The <syntaxhighlight lang="xml" inline><website></syntaxhighlight> element provides the website URL for this specific add-on.


<source lang="xml">
''Example'': <syntaxhighlight lang="xml" inline><website>https://www.myaddonwebsite.com/</website></syntaxhighlight>
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license> <!-- Full license name -->
</source>


===== <forum> =====
====== <nowiki><source></nowiki> ======
The <syntaxhighlight lang="xml" inline><source></syntaxhighlight> element provides the URL for the source code for this specific add-on.


The <code><forum></code> element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.
''Example'': <syntaxhighlight lang="xml" inline><source>https://github.com/someone/myaddon</source></syntaxhighlight>
<source lang="xml">
<forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum>
</source>


===== <website> =====
====== <email> ======
The <syntaxhighlight lang="xml" inline><email></syntaxhighlight> element provides the e-mail address of the author, if they wish to do so for this specific add-on. Here are two examples of how you can format it (the second one is harder for spambots to scrape). This can be left blank if you do not wish to make your e-mail address public.


The <code><website></code> element provides the website URL for this specific add-on.
''Examples'':
* <syntaxhighlight lang="xml" inline><email>[email protected]</email></syntaxhighlight>
* <syntaxhighlight lang="xml" inline><email>foo at bar dot com</email></syntaxhighlight>


<source lang="xml">
====== <lifecyclestate> ======
<website>http://www.myaddonwebsite.com/</website>
{{Note|Kodi v19 Matrix and later.}}
</source>


===== <nowiki><source></nowiki> =====
The <syntaxhighlight lang="xml" inline><lifecyclestate></syntaxhighlight> element will mark the add-on as broken or deprecated in the Kodi repo and provide the reason why. A dialog will be presented to every user that has the add-on installed, so please try to be specific about the underlying reason for the tag. Also, the <syntaxhighlight lang="xml" inline><lifecyclestate></syntaxhighlight> tag presupposes that a version bump has been made to the add-on.


The <code><nowiki><source></nowiki></code> element provides the URL for the source code for this specific add-on.
''Example'': <syntaxhighlight lang="xml" inline><lifecyclestate type="deprecated">Description why deprecated</lifecyclestate></syntaxhighlight>
<syntaxhighlight lang="xml" enclose="div">
<source>http://github.com/someone/myaddon</source>
</syntaxhighlight>


===== <email> =====
At your discretion, it can also be translated into several languages.


The <code><email></code> element provides the email address of the author if he wishes to do so for this specific add-on. Here are two examples of how you can make it look (the second one it harder for spambots to use). This can be left blank if you do not want to make your email address public.
<syntaxhighlight lang="xml" inline><lifecyclestate type="broken" lang="en_GB">Description why broken</lifecyclestate></syntaxhighlight>
<source lang="xml">
<email>[email protected]</email>
    or
<email>foo at bar dot com</email>
</source>


===== <broken> =====
{| class="wikitable"
|+ Valid values for <code>type</code> attribute
! scope="col" | Value
! scope="col" | Meaning
|-
! scope="row" | <code>broken</code>
| To mark add-on as broken and no more usable.
|-
! scope="row" | <code>deprecated</code>
| To mark add-on as deprecated and that it has been replaced by another add-on.
|-
! scope="row" | <code>normal</code>
| (Default) To set add-on as normal. This value is not really needed, but made available to be able to declare all possible life paths.
|}


The <code><broken></code> tag will mark the add-on as broken in the Kodi repo and provide the reason why. A dialog will be presented to every user that has the addon installed, so please try to be specific about the broken reason. Also, the broken tag presupposes that a version bump has been made to the addon.
====== <broken> ======
{{Note|Kodi v18 Leia and earlier. For Matrix and later, see [[Addon.xml#.3Clifecyclestate.3E|§ <lifecyclestate>]]}}


<source lang="xml">
The <syntaxhighlight lang="xml" inline><broken></syntaxhighlight> element will mark the add-on as broken in the Kodi repo and provide the reason why. A dialog will be presented to every user that has the addon installed, so please try to be specific about the underlying reason for the tag. Also, the broken tag presupposes that a version bump has been made to the add-on.
<broken>deprecated</broken>
</source>


===== <assets> =====
''Example'': <syntaxhighlight lang="xml" inline><broken>deprecated</broken></syntaxhighlight>


{{note|Kodi v17 Krypton and later.}}
====== <assets> ======
{{Note|Kodi v17 Krypton and later.}}


The <code><assets></code> element is a manifest that describes the various assets the add-on provides and where they are located. Supported sub-elements are:
The <syntaxhighlight lang="xml" inline><assets></syntaxhighlight> element is a manifest that describes the various assets the add-on provides and where they are located. Supported sub-elements (some optional) are:
* <syntaxhighlight lang="xml" inline><icon></syntaxhighlight> See [[Add-on_structure#icon_png_element|icon.png]] - if an icon.png file exists it must be listed here (mandatory since Kodi v17 Krypton)
* <syntaxhighlight lang="xml" inline><fanart></syntaxhighlight> See [[Add-on_structure#fanart_jpg_element|fanart.jpg]] - if a fanart.jpg file exists it must be listed here (mandatory since Kodi v17 Krypton)
* <syntaxhighlight lang="xml" inline><screenshot></syntaxhighlight> See [[Add-on_structure#screenshot_specifications|screenshots]] - '''(optional)'''


* <code><icon></code> See [[Add-on_structure#icon.png]] - if an icon.png file exists it must be listed here
{{Note|Kodi v18 Leia and later.}}
* <code><fanart></code> See [[Add-on_structure#fanart.jpg]] - if a fanart.jpg file exists it must be listed here
* <syntaxhighlight lang="xml" inline><banner></syntaxhighlight> See [[Add-on_structure#banner_element|banner.jpg]] - '''(optional)'''
* <code><screenshot></code>
* <syntaxhighlight lang="xml" inline><clearlogo></syntaxhighlight> See [[Add-on_structure#clearlogo_element|clearlogo.png]] - '''(optional)'''


If some elements are empty or not specified, it will be treated as non-existing/not provided.
If some elements are empty or not specified, they will be treated as non-existent/not provided. Of all the above sub-elements, only <syntaxhighlight lang="xml" inline><icon></syntaxhighlight> and <syntaxhighlight lang="xml" inline><fanart></syntaxhighlight> are mandatory for add-ons since Kodi v17 Krypton and later.


Example:
''Example'':
<source lang="xml">
<syntaxhighlight lang="xml">
<assets>
  <assets>
     <icon>resources/icon.png</icon>
     <icon>resources/icon.png</icon>
     <fanart>resources/fanart.jpg</fanart>
     <fanart>resources/fanart.jpg</fanart>
    <banner>resources/banner.jpg</banner>
    <clearlogo>resources/clearlogo.png</clearlogo>
     <screenshot>resources/screenshot-01.jpg</screenshot>
     <screenshot>resources/screenshot-01.jpg</screenshot>
     <screenshot>resources/screenshot-02.jpg</screenshot>
     <screenshot>resources/screenshot-02.jpg</screenshot>
     <screenshot>resources/screenshot-03.jpg</screenshot>
     <screenshot>resources/screenshot-03.jpg</screenshot>
     <screenshot>resources/screenshot-04.jpg</screenshot>
     <screenshot>resources/screenshot-04.jpg</screenshot>
</assets>
  </assets>
</source>
</syntaxhighlight>


With the above example definition, the files must be placed in the <code>resources</code> folder.
With the above example definition, the files must be placed in the <code>resources</code> folder.


===== <reuselanguageinvoker> =====
====== <reuselanguageinvoker> ======
{{note|Kodi v18 Leia and later.}}
{{Note|Kodi v18 Leia and later.}}


The <code><reuselanguageinvoker></code> element is a feature introduced with Kodi 18.0 that changes the way the python invoker works in Kodi - trying to reuse the invoker instances as much as possible. As a result, the addon performance is greatly improved. However, note that for the element to work some changes may be required in your addon. Namely, since the invoker is reused, make sure <code>sys.argv</code> is always passed to your entrypoint and propagated throughout your codebase. Do not store it as a class variable.
The <syntaxhighlight lang="xml" inline><reuselanguageinvoker></syntaxhighlight> element is a feature introduced with Kodi 18.0 "Leia" that changes the way the Python invoker works - specifically, attempting to reuse the invoker instances as much as possible. As a result, the add-on performance should be greatly improved. However, note that for the element to work, some changes may be required in your add-on. Namely, since the invoker is reused, make sure <code>sys.argv</code> is always passed to your entrypoint and propagated throughout your codebase. Do ''not'' store it as a class variable.


<source lang="xml">
''Example'': <syntaxhighlight lang="xml" inline><reuselanguageinvoker>true</reuselanguageinvoker></syntaxhighlight>
<reuselanguageinvoker>true</reuselanguageinvoker>
</source>


Furthermore, it is advised to set this element to <code>false</code> while developing the addon, making it only <code>true</code> for the production version (and after testing).
Furthermore, it is advised to set this element to <code>false</code> while developing the add-on, only setting its value to <code>true</code> for the production version (after testing).


== Skin specific elements ==
== Skin-specific elements ==
=== Overview ===
{| class="wikitable"
{| class="prettytable"
! scope="row" | <syntaxhighlight lang="xml" inline><effectslowdown></syntaxhighlight>
| '''effectslowdown'''
| A multiplier that is applied to all <syntaxhighlight lang="xml" inline><animation></syntaxhighlight> effects lengths in the skin; useful for globally slowing down all animations so that you can better configure timings and see interactions between animating controls.
| A multiplier that is applied to all <animation> effect lengths in the skin. Useful to slow down all animations globally so that you can better configure timings and see interactions between animating controls.
|-
|-  
! scope="row" | <syntaxhighlight lang="xml" inline><debugging></syntaxhighlight>
| '''debugging'''
| When set to <code>true</code>, it will display on-screen debugging information (XML filename, mouse position and focused control type/name) on top of the skin.
| When set to true, it'll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.
|-
|-  
! scope="row" | <syntaxhighlight lang="xml" inline><res></syntaxhighlight>
| '''res'''
| Support for arbitrary skin resolutions.
| Support for arbitrary skin resolutions.
|}
|}


=== How window xml files are found ===
=== How window xml files are found ===
Kodi can run in many different resolutions, and a skin should try and cater to all of them. The easiest way is to develop for one specific resolution and make sure that all controls contain <syntaxhighlight lang="xml" inline><width></syntaxhighlight> and <syntaxhighlight lang="xml" inline><height></syntaxhighlight> tags. That way, Kodi can scale the controls to the new screen resolution.


Kodi can run in many differing resolutions, and a skin should try and cater to all these resolutions. The easiest way is to develop for one specific resolution and make sure that all controls contain <width> and <height> tags. That way, Kodi can scale the controls to the new screen resolution.
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4:3 aspect ratios).
 
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).


The order that Kodi looks for it's skin files are as follows:
The order that Kodi looks for it's skin files are as follows:
# It first looks in the current <code>screenmode</code> folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)
# If the current <code>screenmode</code> is 1080i and there's no 1080i folder, it then looks in the 720p folder.
# Finally, it looks in the '''<code>res</code>''' folder.


# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)
This allows you to just put any window files that do not require special treatment for 16:9 aspect ratios, etc., in the <syntaxhighlight lang="xml" inline><defaultresolution></syntaxhighlight> folder, preventing needless repetition.
# If the current screenmode is 1080i and there's no 1080i folder, it then looks in the 720p folder.
# Finally, it looks in the '''res''' folder.


This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the <defaultresolution> folder, preventing needless repetition.
== Examples ==
 
=== Skin add-on ===
= Examples =
<syntaxhighlight lang="xml">
 
== addon.xml for skins ==
 
<syntaxhighlight lang="xml" enclose="div">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<addon id="skin.estuary" version="2.0.22" name="Estuary" provider-name="phil65, Ichabod Fletchman">
<addon id="skin.estuary" version="3.0.10" name="Estuary" provider-name="phil65, Ichabod Fletchman">
<requires>
  <requires>
<import addon="xbmc.gui" version="5.14.0"/>
    <import addon="xbmc.gui" version="5.16.0" />
</requires>
  </requires>
<extension point="xbmc.gui.skin" debugging="false">
  <extension point="xbmc.gui.skin" debugging="false">
<res width="1920" height="1440" aspect="4:3" default="false" folder="xml" />
    <res width="1920" height="1440" aspect="4:3" default="false" folder="xml" />
<res width="1920" height="1280" aspect="3:2" default="false" folder="xml" />
    <res width="1920" height="1280" aspect="3:2" default="false" folder="xml" />
<res width="1920" height="1200" aspect="16:10" default="false" folder="xml" />
    <res width="1920" height="1200" aspect="16:10" default="false" folder="xml" />
<res width="2040" height="1080" aspect="17:9" default="false" folder="xml" />
    <res width="2040" height="1080" aspect="17:9" default="false" folder="xml" />
<res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
    <res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
<res width="2560" height="1080" aspect="21:9" default="false" folder="xml" />
    <res width="2560" height="1080" aspect="21:9" default="false" folder="xml" />
<res width="2338" height="1080" aspect="19.5:9" default="false" folder="xml" />
    <res width="2338" height="1080" aspect="19.5:9" default="false" folder="xml" />
<res width="2160" height="1080" aspect="18:9" default="false" folder="xml" />
    <res width="2160" height="1080" aspect="18:9" default="false" folder="xml" />
</extension>
  </extension>
<extension point="xbmc.addon.metadata">
  <extension point="xbmc.addon.metadata">
<summary lang="en_GB">Estuary skin by phil65. (Kodi's default skin)</summary>
    <platform>all</platform>
<description lang="en_GB">Estuary is the default skin for Kodi 17.0 and above. It attempts to be easy for first time Kodi users to understand and use.</description>
    <license>CC BY-SA 4.0, GNU GENERAL PUBLIC LICENSE Version 2.0</license>
<disclaimer lang="en_GB">Estuary is the default skin for Kodi, removing it may cause issues</disclaimer>
    <forum>https://forum.kodi.tv/</forum>
<platform>all</platform>
    <source>https://github.com/xbmc/xbmc/tree/master/addons/skin.estuary</source>
<license>CC BY-SA 4.0, GPL-2.0</license>
    <assets>
<forum>http://forum.kodi.tv/</forum>
      <icon>resources/icon.png</icon>
<source>https://github.com/xbmc/skin.estuary/</source>
      <fanart>resources/fanart.jpg</fanart>
<assets>
      <screenshot>resources/screenshot-01.jpg</screenshot>
<icon>resources/icon.png</icon>
      <screenshot>resources/screenshot-02.jpg</screenshot>
<fanart>resources/fanart.jpg</fanart>
      <screenshot>resources/screenshot-03.jpg</screenshot>
<screenshot>resources/screenshot-01.jpg</screenshot>
      <screenshot>resources/screenshot-04.jpg</screenshot>
<screenshot>resources/screenshot-02.jpg</screenshot>
      <screenshot>resources/screenshot-05.jpg</screenshot>
<screenshot>resources/screenshot-03.jpg</screenshot>
      <screenshot>resources/screenshot-06.jpg</screenshot>
<screenshot>resources/screenshot-04.jpg</screenshot>
      <screenshot>resources/screenshot-07.jpg</screenshot>
<screenshot>resources/screenshot-05.jpg</screenshot>
      <screenshot>resources/screenshot-08.jpg</screenshot>
<screenshot>resources/screenshot-06.jpg</screenshot>
    </assets>
<screenshot>resources/screenshot-07.jpg</screenshot>
    <summary lang="en_GB">Estuary skin by phil65. (Kodi&apos;s default skin)</summary>
<screenshot>resources/screenshot-08.jpg</screenshot>
    <description lang="en_GB">Estuary is the default skin for Kodi 17.0 and above. It attempts to be easy for first time Kodi users to understand and use.</description>
</assets>
    <disclaimer lang="en_GB">Estuary is the default skin for Kodi, removing it may cause issues</disclaimer>
</extension>
  </extension>
</addon>
</addon>
</syntaxhighlight>
</syntaxhighlight>
One thing to note is that <font color="red">all tag names are lower case.</font> XML tag names are case sensitive!
One thing to note is that {{Red|all tag names are lower case}}. XML tag names are case-sensitive!
 
== addon.xml for scripts ==


<syntaxhighlight lang="xml" enclose="div">
=== Script add-on ===
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon
<addon id="script.artwork.downloader" name="Artwork Downloader" version="12.0.28" provider-name="Martijn">
    id="script.artwork.downloader"
    name="Artwork Downloader"
    version="12.0.12"
    provider-name="Martijn">
   <requires>
   <requires>
     <import addon="xbmc.python"                 version="2.25.0"/>
     <import addon="xbmc.python"               version="2.1.0" />
     <import addon="script.module.elementtree"   version="1.2.7"/>
     <import addon="xmbc.json"                  version="6.0.0" />
     <import addon="script.module.simplejson"   version="2.0.10" optional="true"/>
    <import addon="xbmc.addon"                 version="12.0.0" />
     <import addon="script.common.plugin.cache" version="1.3.0"/>
     <import addon="script.module.simplejson"   version="3.3.0" />
     <import addon="script.common.plugin.cache" version="1.3.0" />
   </requires>
   </requires>
   <extension point="xbmc.python.script"         library="default.py">
   <extension point="xbmc.python.script"       library="default.py">
     <provides>executable</provides>
     <provides>executable</provides>
   </extension>
   </extension>
  <extension point="xbmc.service" library="service.py" start="login"/>
   <extension point="xbmc.addon.metadata">
   <extension point="xbmc.addon.metadata">
     <summary lang="en_GB">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary>
     <summary lang="en_GB">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary>
     <description lang="en_GB">Downloads all available artwork for TV shows, Movies and Musicvideos in your library. Check the options for supported artwork[CR]Artwork sources:[CR]www.fanart.tv[CR]www.thetvdb.com[CR]www.themoviedb.org[CR]Remark:[CR]Check your skin to see what type of artwork is supported![CR]Each TV Show/Movie must have its own folder![CR]Skin integration:[CR]See readme file</description>
     <description lang="en_GB">Downloads all available artwork for TV shows, Movies and Musicvideos in your library. Check the options for supported artwork[CR]Artwork sources:[CR]www.fanart.tv[CR]www.thetvdb.com[CR]www.themoviedb.org[CR]Remark:[CR]Check your skin to see what type of artwork is supported![CR]Each TV Show/Movie must have its own folder![CR]Skin integration:[CR]See readme file</description>
     <disclaimer lang="en_GB">For bugs, requests or general questions visit the Artwork Downloader thread on the Kodi forum.</disclaimer>
     <disclaimer lang="en_GB">For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.</disclaimer>
     <platform>all</platform>
     <platform>all</platform>
     <license>GPL-2.0</license>
     <license>GPL-2.0-or-later</license>
     <forum>...</forum>
     <forum>https://forum.kodi.tv/showthread.php?tid=114633</forum>
     <website>...</website>
     <website>https://kodi.wiki/view/Add-on:Artwork_Downloader</website>
     <email>...</email>
     <email>Martijn@kodi.tv</email>
     <source>...</source>
     <source>https://github.com/XBMC-Addons/script.artwork.downloader</source>
     <news>
     <news>
       v12.0.12:
       v12.0.28
         - Changes ....
         - Don't set simplejson module to optional
      v12.0.27
        - Fix wrong order of listing using votes for artwork from fanart.tv
      …
     </news>
     </news>
     <assets>
     <assets>
Line 576: Line 571:
</syntaxhighlight>
</syntaxhighlight>


=== Common errors ===
== Common errors ==
 
If you are getting errors when installing your Kodi addon, then you may have errors in your addon.xml file, which could be any of the following:
If you are getting errors when installing your Kodi addon, then you may have errors in your addon.xml file, which could be any of the following:
# Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc
# Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc
# Too large description can sometimes cause issues
# Too large description can sometimes cause issues
# You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description>
# You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description>
# If you have directly updated your code and are still finding errors which you know you have fixed, it's possible your cache is still holding the previous version. Try clearing contents of the following folders (or if this fails, reboot your Kodi device):
# If you have directly updated your code and are still finding errors which you know you have fixed, it's possible your cache is still holding the previous version. Try clearing contents of the following folders (or if this fails, reboot your Kodi device):
* .kodi/addons/temp
#* .kodi/addons/temp
* .kodi/temp/temp
#* .kodi/temp/temp
* .kodi/temp/archive_cache
#* .kodi/temp/archive_cache


= Schema Definition =
== Schema Definition ==
The XML schema definition for <code>addon.xml</code> is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].


The XML schema definition for <code>addon.xml</code> is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].
{{Updated|20}}


{{Leia updated}}


[[Category:Add-on development]]
[[Category:Add-on development]]
[[Category:Skin development]]
[[Category:Skin development]]
[[Category:Python]]

Latest revision as of 16:19, 23 January 2023

Home icon grey.png   ▶ Development ▶ Add-on development ▶ Addon.xml

Every skin, script, or plugin in Kodi contains an addon.xml file which describes the add-on, providing credits, version information and dependencies. Below, we will explain how this file is structured and which elements must be used to create an add-on for Kodi. You can also consult the examples at the end to see how this file is laid out depending on if you are developing a skin or script.

Every addon.xml file has the same basic structure, this example is for a video plugin:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You">
  <requires>
    <import addon="xbmc.python" version="2.25.0" />
  </requires>
  <extension point="xbmc.python.pluginsource" library="addon.py">
    <provides>video</provides>
  </extension>
  <extension point="xbmc.addon.metadata">
    <summary lang="en_GB">Your add-on's summary</summary>
    <description lang="en_GB">Your add-on's description</description>
    <disclaimer lang="en_GB"></disclaimer>
    <language>en</language> <!-- language of the content the add-on provides, omit if the add-on does not provide any content -->
    <platform>all</platform>
    <license>GPL-2.0-or-later</license>
    <forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be omitted -->
    <website>http://myplugin.com</website> <!-- URL of the website that supplies the content, or the website for your plugin; may be omitted. -->
    <email>[email protected]</email> <!-- may be omitted -->
    <source>http://github.com/you/plugin.addon.id</source>
    <news>v1.2.3 (01/02/2013)
      [new] some new feature
      [fix] some fix
    </news>
    <assets>
        <icon>resources/icon.png</icon>
        <fanart>resources/fanart.jpg</fanart>
        <banner></banner> <!-- optional -->
        <clearlogo>resources/clearlogo.png</clearlogo> <!-- optional -->
        <screenshot></screenshot> <!-- optional, max. 10 -->
    </assets>
  </extension>
</addon>

There are a few important things to note in the above sample:

  • The <addon> element must be present, and be the root node. It presents data about the add-on package as a whole. Inside it should be:
    • A <requires> element, listing all the dependencies that this add-on needs in order to function inside individual <import> elements for each one.
    • One or more <extension> elements, each of which describes a part of Kodi that the add-on extends.
      • Finally, there is a specific extension element, <extension point="xbmc.addon.metadata"> that describes the add-on to the user.
        • Image assets such as icons, a banner and screenshots declared inside their own named elements inside of an <assets> tag (exclusive to Kodi v18+)

Core elements

<addon>

The <addon> element has 4 attributes, and they are all required: id, version, name, and provider-name.

Example: <addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2">

id attribute

The id attribute is the unique identifier used for this add-on. It must be unique, and must use only lowercase characters, periods, underscores, dashes and numbers. This identifier is also used as the name of the folder that contains the add-on, so for ease of searching, we suggest you use something like type.uniquename.

version attribute

The version attribute is used by Kodi to determine whether updates are available. This should be use a version scheme like x.y.z (major.minor.patch). For example: version="0.0.1". Generally, you'll start with a version of 0.y.z for test releases and once you feel it is ready for a full release, you'd bump the version to 1.0.0.

How versioning works
  • 2.2.9 is newer than 2.2.1
  • 2.2.10 is newer than 2.2.1
  • 2.3.0 is newer than 2.2.9
  • 2.2.1 is newer than 2.2.1~alpha
  • 2.2.1 is newer than 2.2.1~beta
  • 2.2.1~beta is newer than 2.2.1~alpha
  • 2.2.1~beta3 is newer than 2.2.1~beta2
  • 2.2.1~beta10 is newer than 2.2.1~beta1
Tip Tip: Text should only be added for a beta version. In other cases version number should only contain numbers.

name attribute

The name attribute is the name of the add-on as it appears in the UI. This should be in English where it makes sense for it to be so, and is not translatable.

provider-name attribute

The provider-name attribute is used as the author field. This could be a team of authors or a single author. If the add-on is maintained by multiple people please separate them with a comma (,).

<requires>

The <requires> element contains one or more <import> elements which specify which other add-ons this particular add-on requires, and which version of those add-ons it requires. These add-ons may be part of Kodi itself, or may be parts of other third-party add-ons.

Kodi will only allow the add-on to be run if suitable versions of the (non-optional) add-ons on which this add-on depends are installed. When a user installs your add-on from an online repository via Kodi's add-on manager, Kodi attempts to resolve these dependencies, and install anything that your add-on relies on first. The dependency must be provided with the minimum version number your script/skin requires.

Examples: Here is a sample <requires> block that imports two required modules:

<requires>
  <import addon="xbmc.python"               version="2.25.0" />
  <import addon="script.module.elementtree" version="1.2.7" />
</requires>

Here's another example, which will only install on LibreELEC. This occurs because the addon will depend on an addon that only exists in LibreELEC. Hence, Kodi will refuse to install the addon in other platforms due to unmet dependencies:

<requires>
  <import addon="os.librelec.tv" version="2.0" />
</requires>

<import>

Each <import> element describes one dependency for an add-on, with two required attributes: addon and version. There is also an optional attribute called, fittingly, optional.

If your add-on relies on other third-party add-ons, Kodi will automatically install them as well, provided they are available on an existing add-on repository. If they aren't available on any existing repository, the user must install the other add-ons themselves. Note that you need to include any Python libraries you need directly in your add-on; these can't be loaded with an <import> element, since Kodi wouldn't know what to do with them.

addon attribute

The addon attribute specifies the id of the required add-on, e.g. script.module.elementtree.

version attribute

The version attribute specifies the minimum version of the required add-on to be installed.

Dependency versions

Each different Kodi version might require you to use a higher version of the xbmc.* add-on dependencies to control on which version of Kodi the add-on can be installed.

Each Kodi version contain a certain backwards compatibility. For example add-ons made for Gotham 13.x can still work on Leia 18.x. Same happens for Matrix and Nexus addons. Do note that this might change in the future. The ABI version you see in the table above is the backwards compatibility version for which add-ons are still marked "working".

optional attribute

The dependency may be made optional by setting the optional attribute to true. This will only install the dependency when the add-on actually needs it. Even if this dependency is missing, the add-on can still be installed.

<extension>

The <extension> element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of Kodi that the add-on extends. For instance, the addon.xml file for the Confluence skin extends the xbmc.gui.skin part of xbmc. All available extension points are given below.

point attribute

The various extension points that Kodi provides are given in the list below.

Add-ons that don't correspond to a specific add-on category can not be installed by users. These are usually supporting or shared add-ons that are installed automatically by the add-ons that require them.

xbmc.python.pluginsource

The most common extension point that will be used by plugin addon developers is xbmc.python.pluginsource.

library attribute

The <extension point="xbmc.python.pluginsource"> element has an extra attribute: library. This is the name of the Python script (startup script) that will be run when the add-on is activated. This file must exist in the root of your add-on directory.

<provides> element

The extension has an additional child element named <provides>, which contains a whitespace separated list of audio, executable, image and/or video. This determines in what area (or context) of the Kodi system your addon will make itself visible in (please note that this applies only to pluginsource extension points):

Note: If the <provides> element is not defined, behavior will depend on the structure of your add-on. If it has a single extension point (e.g. a single xbmc.python.script or xbmc.python.pluginsource), Kodi will default to executable (thus your add-on will be shown in Programs). If your add-on has multiple extension points and none specifies a <provides> element, different entries for your add-on will be shown in "Programs" (multiple fallbacks to "executable"). If your add-on has multiple extension points and only one (or some) define the <provides> tag it really depends on the order of the extension points. If the first extension point (your add-on's main extension point) defines the <provides> element, Kodi will assume all the other (empty) extension points provide the same content. Otherwise, it will set the content for all the extension points that specify the <provides> tag and fallback all the others to "executable". At the moment, there is no way to hide an add-on from the interface.

Example:

<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py">
  <provides>audio video</provides>
</extension>
xbmc.addon.metadata

This special extension point must be provided by all add-ons, and is the way that your add-on is described to users of the Kodi add-on manager. There are several elements that this should contain. Most of these elements are required (except the deprecated tag). However, in case the elements do not apply (e.g. language, website, email) they can be omitted from the addon.xml file.

Localization

Language specific elements must always be present in English as a minimum. Many of these elements can be translated into multiple languages and should be added once for each supported language. The lang attribute should contain a locale identifier. If omitted, it defaults to en_GB. Note: Kodi v14 and older uses ISO-639 code. See List of language codes (ISO-639:1988)

<summary>

One or more <summary> elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.

Example: <summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary>

<description>

One or more <description> elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.

Example:

<description lang="en_GB">Hello World script provides some basic examples on how to create your first script and hopefully will increase the number of Kodi users to start creating their own addons.</description>
<disclaimer>

One or more <disclaimer> elements that indicate what (if any) things the user should know about the add-on. There is no need to have a disclaimer if you don't want one, though if something requires settings, or only works in a particular country then you may want to state this here. It may be translated into multiple languages.

Example: <disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer>

<news>

Note: Used in Kodi v17 Krypton and later only. Older versions are forward compatible.

The <news> element should contains a simple description of the major changes made to the add-on (new functionality, big fixes, etc). This is displayed in the Kodi addon installation/update system. (In the author's opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that they may have been having has been fixed or not.) Please keep it short (it's limited to 1500 characters); you might want to only include the changes for the last version here.

Here is an example:

<news>v0.1.2  (2014-01-15)
- Added notification for Ubuntu users checking through apt command</news>
<platform>

The <platform> tag specifies which platforms (operating systems, hardware, architecture) this add-on runs on. Many add-ons will run on all platforms, so all is an option. If the platform tag is missing, we assume the add-on runs on all platforms. A space-delimited combination of these is also possible. Currently available options are:

  • all
  • linux
  • osx
  • osx64
  • osx-x86_64
  • osx32
  • osx-i686
  • ios
  • ios-armv7
  • ios-aarch64
  • windx
  • windows
  • windows-i686
  • windows-x86_64
  • windowsstore
  • android
  • android-armv7
  • android-aarch64
  • android-i686

Note: Kodi v19 Matrix and later.

  • tvos
  • tvos-aarch64

Example: <platform>linux osx-x86_64 windows-x86_64</platform>

<language>

The <language> elements indicate the language(s) of the content provided by your add-on. It applies to plugins, scripts, scrapers, etc. This allows browsing the add-on list by language. When there is no specific language provided in your content, omit it from the addon.xml.

Example: <language>en de fr</language>

<license>

The <license> element indicates what license is used for this add-on. In general, the SPDX License Expression for the license(s) are preferable to the full license name:

Examples:
SPDX License Expression: <license>GPL-2.0-or-later</license>
vs
Full license name: <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>

If your add-on includes multiple licenses:

  • Separate license names using | (the pipe or vertical bar character) when there is a choice between licenses:
    • <license>GPL-2.0-or-later | LGPL-2.0-or-later</license>
  • Separate license names using & (ampersand), or , (comma), when multiple licenses exist that cover different parts of the source.
    • <license>GPL-2.0-or-later & MIT</license>
    • <license>GPL-2.0-or-later, MIT</license>
<forum>

The <forum> element provides the forum thread URL for this specific add-on. Omit this element if there is no forum thread.

Example: <forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum>

<website>

The <website> element provides the website URL for this specific add-on.

Example: <website>https://www.myaddonwebsite.com/</website>

<source>

The <source> element provides the URL for the source code for this specific add-on.

Example: <source>https://github.com/someone/myaddon</source>

<email>

The <email> element provides the e-mail address of the author, if they wish to do so for this specific add-on. Here are two examples of how you can format it (the second one is harder for spambots to scrape). This can be left blank if you do not wish to make your e-mail address public.

Examples:

<lifecyclestate>

Note: Kodi v19 Matrix and later.

The <lifecyclestate> element will mark the add-on as broken or deprecated in the Kodi repo and provide the reason why. A dialog will be presented to every user that has the add-on installed, so please try to be specific about the underlying reason for the tag. Also, the <lifecyclestate> tag presupposes that a version bump has been made to the add-on.

Example: <lifecyclestate type="deprecated">Description why deprecated</lifecyclestate>

At your discretion, it can also be translated into several languages.

<lifecyclestate type="broken" lang="en_GB">Description why broken</lifecyclestate>

Valid values for type attribute
Value Meaning
broken To mark add-on as broken and no more usable.
deprecated To mark add-on as deprecated and that it has been replaced by another add-on.
normal (Default) To set add-on as normal. This value is not really needed, but made available to be able to declare all possible life paths.
<broken>

Note: Kodi v18 Leia and earlier. For Matrix and later, see § <lifecyclestate>

The <broken> element will mark the add-on as broken in the Kodi repo and provide the reason why. A dialog will be presented to every user that has the addon installed, so please try to be specific about the underlying reason for the tag. Also, the broken tag presupposes that a version bump has been made to the add-on.

Example: <broken>deprecated</broken>

<assets>

Note: Kodi v17 Krypton and later.

The <assets> element is a manifest that describes the various assets the add-on provides and where they are located. Supported sub-elements (some optional) are:

  • <icon> See icon.png - if an icon.png file exists it must be listed here (mandatory since Kodi v17 Krypton)
  • <fanart> See fanart.jpg - if a fanart.jpg file exists it must be listed here (mandatory since Kodi v17 Krypton)
  • <screenshot> See screenshots - (optional)

Note: Kodi v18 Leia and later.

If some elements are empty or not specified, they will be treated as non-existent/not provided. Of all the above sub-elements, only <icon> and <fanart> are mandatory for add-ons since Kodi v17 Krypton and later.

Example:

  <assets>
    <icon>resources/icon.png</icon>
    <fanart>resources/fanart.jpg</fanart>
    <banner>resources/banner.jpg</banner>
    <clearlogo>resources/clearlogo.png</clearlogo>
    <screenshot>resources/screenshot-01.jpg</screenshot>
    <screenshot>resources/screenshot-02.jpg</screenshot>
    <screenshot>resources/screenshot-03.jpg</screenshot>
    <screenshot>resources/screenshot-04.jpg</screenshot>
  </assets>

With the above example definition, the files must be placed in the resources folder.

<reuselanguageinvoker>

Note: Kodi v18 Leia and later.

The <reuselanguageinvoker> element is a feature introduced with Kodi 18.0 "Leia" that changes the way the Python invoker works - specifically, attempting to reuse the invoker instances as much as possible. As a result, the add-on performance should be greatly improved. However, note that for the element to work, some changes may be required in your add-on. Namely, since the invoker is reused, make sure sys.argv is always passed to your entrypoint and propagated throughout your codebase. Do not store it as a class variable.

Example: <reuselanguageinvoker>true</reuselanguageinvoker>

Furthermore, it is advised to set this element to false while developing the add-on, only setting its value to true for the production version (after testing).

Skin-specific elements

<effectslowdown> A multiplier that is applied to all <animation> effects lengths in the skin; useful for globally slowing down all animations so that you can better configure timings and see interactions between animating controls.
<debugging> When set to true, it will display on-screen debugging information (XML filename, mouse position and focused control type/name) on top of the skin.
<res> Support for arbitrary skin resolutions.

How window xml files are found

Kodi can run in many different resolutions, and a skin should try and cater to all of them. The easiest way is to develop for one specific resolution and make sure that all controls contain <width> and <height> tags. That way, Kodi can scale the controls to the new screen resolution.

However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4:3 aspect ratios).

The order that Kodi looks for it's skin files are as follows:

  1. It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)
  2. If the current screenmode is 1080i and there's no 1080i folder, it then looks in the 720p folder.
  3. Finally, it looks in the res folder.

This allows you to just put any window files that do not require special treatment for 16:9 aspect ratios, etc., in the <defaultresolution> folder, preventing needless repetition.

Examples

Skin add-on

<?xml version="1.0" encoding="UTF-8"?>
<addon id="skin.estuary" version="3.0.10" name="Estuary" provider-name="phil65, Ichabod Fletchman">
  <requires>
    <import addon="xbmc.gui" version="5.16.0" />
  </requires>
  <extension point="xbmc.gui.skin" debugging="false">
    <res width="1920" height="1440" aspect="4:3" default="false" folder="xml" />
    <res width="1920" height="1280" aspect="3:2" default="false" folder="xml" />
    <res width="1920" height="1200" aspect="16:10" default="false" folder="xml" />
    <res width="2040" height="1080" aspect="17:9" default="false" folder="xml" />
    <res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
    <res width="2560" height="1080" aspect="21:9" default="false" folder="xml" />
    <res width="2338" height="1080" aspect="19.5:9" default="false" folder="xml" />
    <res width="2160" height="1080" aspect="18:9" default="false" folder="xml" />
  </extension>
  <extension point="xbmc.addon.metadata">
    <platform>all</platform>
    <license>CC BY-SA 4.0, GNU GENERAL PUBLIC LICENSE Version 2.0</license>
    <forum>https://forum.kodi.tv/</forum>
    <source>https://github.com/xbmc/xbmc/tree/master/addons/skin.estuary</source>
    <assets>
      <icon>resources/icon.png</icon>
      <fanart>resources/fanart.jpg</fanart>
      <screenshot>resources/screenshot-01.jpg</screenshot>
      <screenshot>resources/screenshot-02.jpg</screenshot>
      <screenshot>resources/screenshot-03.jpg</screenshot>
      <screenshot>resources/screenshot-04.jpg</screenshot>
      <screenshot>resources/screenshot-05.jpg</screenshot>
      <screenshot>resources/screenshot-06.jpg</screenshot>
      <screenshot>resources/screenshot-07.jpg</screenshot>
      <screenshot>resources/screenshot-08.jpg</screenshot>
    </assets>
    <summary lang="en_GB">Estuary skin by phil65. (Kodi&apos;s default skin)</summary>
    <description lang="en_GB">Estuary is the default skin for Kodi 17.0 and above. It attempts to be easy for first time Kodi users to understand and use.</description>
    <disclaimer lang="en_GB">Estuary is the default skin for Kodi, removing it may cause issues</disclaimer>
  </extension>
</addon>

One thing to note is that all tag names are lower case. XML tag names are case-sensitive!

Script add-on

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.artwork.downloader" name="Artwork Downloader" version="12.0.28" provider-name="Martijn">
  <requires>
    <import addon="xbmc.python"                version="2.1.0" />
    <import addon="xmbc.json"                  version="6.0.0" />
    <import addon="xbmc.addon"                 version="12.0.0" />
    <import addon="script.module.simplejson"   version="3.3.0" />
    <import addon="script.common.plugin.cache" version="1.3.0" />
  </requires>
  <extension point="xbmc.python.script"        library="default.py">
    <provides>executable</provides>
  </extension>
  <extension point="xbmc.addon.metadata">
    <summary lang="en_GB">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary>
    <description lang="en_GB">Downloads all available artwork for TV shows, Movies and Musicvideos in your library. Check the options for supported artwork[CR]Artwork sources:[CR]www.fanart.tv[CR]www.thetvdb.com[CR]www.themoviedb.org[CR]Remark:[CR]Check your skin to see what type of artwork is supported![CR]Each TV Show/Movie must have its own folder![CR]Skin integration:[CR]See readme file</description>
    <disclaimer lang="en_GB">For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.</disclaimer>
    <platform>all</platform>
    <license>GPL-2.0-or-later</license>
    <forum>https://forum.kodi.tv/showthread.php?tid=114633</forum>
    <website>https://kodi.wiki/view/Add-on:Artwork_Downloader</website>
    <email>[email protected]</email>
    <source>https://github.com/XBMC-Addons/script.artwork.downloader</source>
    <news>
      v12.0.28
        - Don't set simplejson module to optional
      v12.0.27
        - Fix wrong order of listing using votes for artwork from fanart.tv
      …
    </news>
    <assets>
        <icon>resources/images/icon.png</icon>
        <fanart>resources/images/fanart.png</fanart>
        <screenshot>resources/images/screenshot.png</screenshot>
    </assets>
  </extension>
</addon>

Common errors

If you are getting errors when installing your Kodi addon, then you may have errors in your addon.xml file, which could be any of the following:

  1. Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc
  2. Too large description can sometimes cause issues
  3. You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description>
  4. If you have directly updated your code and are still finding errors which you know you have fixed, it's possible your cache is still holding the previous version. Try clearing contents of the following folders (or if this fails, reboot your Kodi device):
    • .kodi/addons/temp
    • .kodi/temp/temp
    • .kodi/temp/archive_cache

Schema Definition

The XML schema definition for addon.xml is located here.