https://kodi.wiki/api.php?action=feedcontributions&user=Leopheard&feedformat=atomOfficial Kodi Wiki - User contributions [en]2024-03-29T06:29:01ZUser contributionsMediaWiki 1.39.6https://kodi.wiki/index.php?title=HOW-TO:Update_a_pull_request_to_an_official_addon_repository_on_GitHub&diff=180422HOW-TO:Update a pull request to an official addon repository on GitHub2019-09-02T03:24:55Z<p>Leopheard: See also</p>
<hr />
<div>A pull request (PR) to an official addon repository (for scripts, plugins or other) on GitHub must have exactly one commit. This is necessary to keep clean commit history in the repo with each commit representing a single addon addition or update. However, you may be asked to make some changes into your PR before it will be submitted. The following procedure allows you to update your PR without creating a new commit:<br />
<br />
1. Make all necessary changes in your addon PR.<br />
<br />
2. Commit your changes to the PR branch using the following commands:<br />
<br />
git add .<br />
git commit -a --amend --no-edit<br />
<br />
3. Push your changes to GitHub. Since you have rewritten the commit history you need to use <code>--force</code> option:<br />
<br />
git push -f<br />
<br />
Now you PR will be updated and you still have one commit in the PR.<br />
<br />
N.B. It is advisable to only update or push one addon at one time and wait til the request has completed before pushing the next update.<br />
<br />
=== See also ===<br />
* [[HOW-TO:Create add-on PRs using Git Subtree Merging]]</div>Leopheardhttps://kodi.wiki/index.php?title=HOW-TO:Update_a_pull_request_to_an_official_addon_repository_on_GitHub&diff=179702HOW-TO:Update a pull request to an official addon repository on GitHub2019-08-30T23:20:56Z<p>Leopheard: </p>
<hr />
<div>A pull request (PR) to an official addon repository (for scripts, plugins or other) on GitHub must have exactly one commit. This is necessary to keep clean commit history in the repo with each commit representing a single addon addition or update. However, you may be asked to make some changes into your PR before it will be submitted. The following procedure allows you to update your PR without creating a new commit:<br />
<br />
1. Make all necessary changes in your addon PR.<br />
<br />
2. Commit your changes to the PR branch using the following commands:<br />
<br />
git add .<br />
git commit -a --amend --no-edit<br />
<br />
3. Push your changes to GitHub. Since you have rewritten the commit history you need to use <code>--force</code> option:<br />
<br />
git push -f<br />
<br />
Now you PR will be updated and you still have one commit in the PR.<br />
<br />
N.B. It is advisable to only update or push one addon at one time and wait til the request has completed before pushing the next update.</div>Leopheardhttps://kodi.wiki/index.php?title=Plugin_sources&diff=177632Plugin sources2019-08-04T04:56:13Z<p>Leopheard: /* Interacting with Kodi */</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}<br />
<br />
Plugin sources are [[Add-on development|add-ons for Kodi]] that provide a media listing for the user. They are currently written in python, and can provide video, music, image or executable content. Once a user installs your plugin source, it will automatically show up in the appropriate section(s) within Kodi based on the content it provides.<br />
<br />
== Basic overview ==<br />
When the user clicks on your plugin source, your python plugin gets called, allowing you to fetch a listing of media and return it for Kodi to display. You may return either media items directly (for immediate playback) or may return folder items that contain links back into your plugin source. When the user clicks on a media item it'll start playing straight away, just like any other media. When the user clicks on a folder that you provide, your plugin will be called again with information on what folder item was clicked on given in the arguments. You may then return a different listing of media content and folders as required.<br />
<br />
== What Kodi requires for your add-on ==<br />
For Kodi to know what to do with your add-on, we require your plugin, and an addon.xml file which describes your plugin source. See [[Add-on development|here]] for more information on addon.xml, including how you add descriptions to your addon for users. A plugin source extends Kodi via the xbmc.python.pluginsource extension point. The layout of the XML describing this extension point is as follows:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<extension point="xbmc.python.pluginsource"<br />
library="myplugin.py"><br />
<provides>image video</provides><br />
</extension><br />
</syntaxhighlight><br />
<br />
The library attribute provides the file of the python plugin that contains the main entry point of your plugin. The <provides> element is a whitespace separated list of image, video, audio, executable. There is a [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.python/pluginsource.xsd schema available here] to check you have your XML correctly defined.<br />
<br />
== Interacting with Kodi ==<br />
The main form of interacting with Kodi will be parsing what Kodi feeds you in terms of arguments to your plugin to find out what "folder" the user wants to retrieve, and then returning items to Kodi as you construct them. Given that your plugin 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.xml file (in resources/language/<name_of_language>/strings.xml) 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. '''N.B.''' From Kodi 19 onwards, strings.xml has been replaced with [[Language_support#What_is_strings.po|strings.po]].<br />
<br />
Your plugin only runs while it's retrieving a listing - once it has finished the listing it is terminated. Thus, if you wish to store state information, you can do so either in the URLs you return to Kodi (for different folders for instance) or by storing information in a settings file. In addition, you may have particular configuration settings for your addon which can also be accessed via the settings functions in the [[xbmcaddon module]].<br />
<br />
If your plugin can provide several content types, Kodi will pass a 'content_type' parameter to the plugin when listing the root directory. This can be used to only return content of the requested type.<br />
<br />
== See also ==<br />
<br />
'''Development:'''<br />
* [[Add-on development]]<br />
* [[Python development]]<br />
<br />
[[Category:Add-on development]]<br />
[[Category:Development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Add-on_structure&diff=177033Add-on structure2019-08-02T17:43:48Z<p>Leopheard: /* resources/ */</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br />
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC. This system allows third-party developed enhancements to Kodi to be distributed to Kodi users directly from inside the Kodi interface.<br />
<br />
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].<br />
<br />
== Introduction ==<br />
<br />
Each add-on is kept in its own folder, and is described via an XML file named <code>addon.xml</code>. In addition, some other files can also come with the add-on, such as <code>icon.png</code>, <code>changelog.txt</code>, and <code>fanart.jpg</code>. These are all optional, though we encourage you to at least have <code>icon.png</code>. All of these reside in the "root" of the folder that contains the add-on. Additional data may be contained within a <code>resources/</code> subfolder, such as language translations and descriptions of settings.<br />
<br />
When installed, the whole add-on folder will be placed inside <code>.xbmc/addons/</code>.<br />
<br />
== Directory Name ==<br />
<br />
Your directory name should follow this convention: <code><addon-type>[.<media-type>].<your-plugin-name></code><br />
<br />
Each name part is case sensitive and must be in lower case. The dot character separates each name part; you can use further dots to separate things in your plugin name if you wish. Alternatively, you may use a hyphen (-). No other non-alphanumeric characters should be used.<br />
<br />
<code>addon-type</code> is one of the following:<br />
<br />
{| class="prettytable" border="1"<br />
!Add-on Type<br />
!Description<br />
!Media Type Required?<br />
|-<br />
|<code>repository</code><br />
|A repository definition file that allows users to add new repositories to the Kodi addon manager.<br />
|No<br />
|-<br />
|<code>plugin</code><br />
|A plugin script or module that adds to the functionality of Kodi. Plugins appear under the relevant media section of the main home menu.<br />
|'''Yes'''<br />
|-<br />
|<code>script</code><br />
|A runnable program file that will appear in the Program section of the main home menu.<br />
|'''Yes'''<br />
|-<br />
|<code>skin</code><br />
|An Kodi skin definition and its supporting script files.<br />
|No<br />
|-<br />
|<code>resource</code><br />
|An addon that will provide additional files (language files, images, [[sounds.xml|uisounds]]).<br />
|No<br />
|}<br />
<br />
The following table describes the available <code>media-type</code>s for the available add-on types. Your add-on may provide more than one <code>media-type</code> if<br />
you wish, whereby it will appear in more than one section. In most cases, however, a single media type will suffice, and it may be preferable to have multiple add-ons each providing a single media type rather than one add-on that tries to do it all.<br />
<br />
{| class="prettytable" border="1"<br />
!Add-on Type<br />
!Media Type<br />
! Description<br />
|-<br />
|<code>plugin</code><br />
|<code>audio</code><br />
|A music add-on that will appear in the Music main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>video</code><br />
|A video add-on that will appear in the Video main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>picture</code><br />
|A picture add-on that will appear in the Pictures main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>program</code><br />
|A program add-on that will appear in the Add-ons main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>weather</code><br />
|A weather add-on that will appear in the Weather main menu. You can omit the Add-on Type in the directory name and addon-id<br />
|-<br />
|<code>script</code><br />
|<code>module</code><br />
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.<br />
|-<br />
|<code>script</code><br />
|<code>service</code><br />
|A script that will be run at either login or startup<br />
|}<br />
<br />
The add-on name is up to you, but be sure that it isn't already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with Kodi for audio podcasts you might name your directory <code>plugin.audio.gpodder-xbmc3</code>. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be <code>plugin.video.my-great-tv-com</code>. A script to ping all your friends on twitter to tell them you are home might be called<br />
<code>script.service.ping-twits-i-am-home</code>.<br />
<br />
== Directory structure ==<br />
<br />
Your directory contains all the resources needed to operate your add-on. The directory must be considered read-only and should not be used for storing transient or inter-session data. Other mechanisms are available to do that (more later). The directory should be structured as follows:<br />
<br />
=== Kodi v17 Krypton and up===<br />
addon.py<br />
addon.xml<br />
LICENSE.txt<br />
resources/<br />
settings.xml<br />
language/<br />
lib/<br />
data/<br />
media/<br />
fanart.jpg<br />
icon.png<br />
<br />
=== Kodi v16 Jarvis and earlier===<br />
addon.py<br />
addon.xml<br />
fanart.jpg<br />
icon.png<br />
LICENSE.txt<br />
changelog.txt<br />
resources/<br />
settings.xml<br />
language/<br />
lib/<br />
data/<br />
media/<br />
<br />
Other files may be required to run your add-on, if your add-on becomes more complex. It is considered good practice to place various add-on resources and support code modules in the <code>lib/</code> folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. <code>script.module.foo</code>.<br />
<br />
The most important thing to remember from this is that everything that doesn't need to be in the root of your directory is considered a resource and should be placed inside <code>resources/</code> or one of its subdirectories. Also remember, all the above is a ''recommended'' outline for your add-on; if you need fewer or more<br />
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.<br />
<br />
=== addon.py ===<br />
<br />
This will contain the main Python code for your add-on. You can name it whatever you want, since you'll define this Python file in <code>[[addon.xml]]</code> as your main script file.<br />
<br />
=== addon.xml ===<br />
{{See also|addon.xml}}<br />
<br />
<code>addon.xml</code> gives Kodi important metadata about your add-on, such as:<br />
* what the add-on provides<br />
* what the add-on relies on to work<br />
* what script to run when it is fired up (if it is meant to be started)<br />
<br />
<br />
=== changelog.txt ===<br />
<br />
{{note|Deprecated in Kodi v17 Krypton. Replaced by [[Addon.xml#.3Cnews.3E]]}}<br />
<br />
A text file that contains a description of the changes you make to the add-on for each release. This is displayed in the Kodi addon installation/update system. The recommended format is to have it sorted by version in descending order, with a simple description as to the major changes (new functionality, big fixes, etc) in each version. (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<br />
they may have been having has been fixed or not.)<br />
<br />
Here is a sample<br />
<code>changelog.txt:<br />
<br />
v0.1.3 (2015-12-25)<br />
- Update with 15.0 Isengard<br />
<br />
v0.1.2 (2014-1-15)<br />
- Add notification for Ubuntu users checking through apt command<br />
<br />
v0.1.1 (2014-1-1)<br />
- Initial version<br />
</code><br />
<br />
It is recommend to add a date so users know when last update was done. Best is to use YYYY-MM-DD as this is the least confusing way of dat notation.<br />
<br />
=== icon.png ===<br />
<br />
This is an icon used to represent your add-on in various parts of Kodi. In order to keep a coherent look and give the skinner a good idea how the icons of the add-ons look, we have defined the following rules:<br />
<br />
* The icon size must be 256x256 pixels or 512x512 pixels.<br />
* File format is PNG.<br />
* Background must be 100% solid. That doesn't mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.<br />
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.<br />
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).<br />
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.<br />
* Don't mix logos with Kodi's logo; it's obvious that we're talking about Kodi here.<br />
* Don't add borders or any overlays, that's the skinner's job. However, if borders are an element of your logo, make sure there is enough padding.<br />
* It is suggested that a logo on a plain background (non-transparent) is best in many situations (e.g. for addons that retrieve media from an online service, use that service's logo ''as long as you are free to do so'').<br />
* {{note|Kodi v17 Krypton and later}} if this file exists, "icon" must be listed in '''[[Addon.xml#<assets>|addon.xml assets]]'''<br />
<br />
=== fanart.jpg ===<br />
<br />
This helps to keep Kodi graphically rich when browsing and using add-ons. Some simple guidelines:<br />
<br />
* It should be 16:9 aspect ratio<br />
* It is intended for the background, so should be simple and without text where reasonable.<br />
* We recommend a 1280x720 JPEG image. It should certainly be no larger than 1920x1080.<br />
* We recommend keeping it as small as is reasonable with respect to file-size. Remember that hundreds of thousands of users are going to be downloading this.<br />
* {{note|Kodi v17 Krypton and later}} if this file exists, "fanart" must be listed in '''[[Addon.xml#<assets>|addon.xml assets]]'''<br />
<br />
=== LICENSE.txt ===<br />
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}<br />
<br />
This file should contain the text of whatever software license you've chosen to release your add-on under (e.g. GPLv2).<br />
<br />
=== resources/ ===<br />
<br />
The <code>resources/</code> subdirectory is the preferred place to put any files that the add-on uses that don't need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in <code>resources/</code> or one of its subdirectories.<br />
<br />
If you are having errors running the application (e.g. kodi.log shows addon.py isn't found) then a possible cause may be the __init__.pyo file are missing from this folder. Try copying it from another addon.<br />
<br />
==== resources/settings.xml ====<br />
{{See also|Add-on settings}}<br />
<br />
This is an XML file that defines the user-configurable settings used by the add-on. The file defines the names and types of the settings, and how they should appear in the settings dialog for the add-on.<br />
<br />
==== resources/language/ ====<br />
<br />
'''Translation tools:'''<br />
* [[Language support]]<br />
* [[Translation System]]<br />
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]<br />
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]<br />
* Utility for keeping Kodi upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]<br />
<br />
<br />
'''String ID range:'''<br />
* strings 31000 thru 31999 reserved for skins<br />
<br />
'''strings.po'''<br />
<br />
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}<br />
<br />
==== resources/lib/ ====<br />
<br />
Put any module definitions or third party software libraries into this directory.<br />
<br />
If you are having errors running the application (e.g. kodi.log shows addon.py isn't found) then a possible cause may be the __init__.pyo & __init__.py files are missing in this folder. Try copying it from another addon.<br />
<br />
==== resources/data/ ====<br />
<br />
Store any other static data structures your application requires here. Examples might be<br />
XLT/XSD files or static XML files that contain lookup tables etc.<br />
<br />
==== resources/media/ ====<br />
<br />
Store any static media (picture, audio, video etc.) files in this directory.<br />
<br />
== Getting started ==<br />
<br />
Following pages will explain in more depth to get started. Providing examples, background information and useful links.<br />
<br />
* [[Python development]]<br />
* [[Skinning]]<br />
<br />
== See also ==<br />
* [[Add-ons]]<br />
* [[:Category:All add-ons]]<br />
* [[3rd party add-on repositories]]<br />
'''Development:'''<br />
* [[Add-on development]]<br />
* [[Addon Settings]]<br />
* [[Python development]]<br />
* [[Skinning]]<br />
* [[Add-on repositories]]<br />
* [[Official add-on repository]]<br />
<br />
[[Category:Add-on development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Add-on_structure&diff=177032Add-on structure2019-08-02T17:42:30Z<p>Leopheard: /* resources/lib/ */</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br />
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC. This system allows third-party developed enhancements to Kodi to be distributed to Kodi users directly from inside the Kodi interface.<br />
<br />
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].<br />
<br />
== Introduction ==<br />
<br />
Each add-on is kept in its own folder, and is described via an XML file named <code>addon.xml</code>. In addition, some other files can also come with the add-on, such as <code>icon.png</code>, <code>changelog.txt</code>, and <code>fanart.jpg</code>. These are all optional, though we encourage you to at least have <code>icon.png</code>. All of these reside in the "root" of the folder that contains the add-on. Additional data may be contained within a <code>resources/</code> subfolder, such as language translations and descriptions of settings.<br />
<br />
When installed, the whole add-on folder will be placed inside <code>.xbmc/addons/</code>.<br />
<br />
== Directory Name ==<br />
<br />
Your directory name should follow this convention: <code><addon-type>[.<media-type>].<your-plugin-name></code><br />
<br />
Each name part is case sensitive and must be in lower case. The dot character separates each name part; you can use further dots to separate things in your plugin name if you wish. Alternatively, you may use a hyphen (-). No other non-alphanumeric characters should be used.<br />
<br />
<code>addon-type</code> is one of the following:<br />
<br />
{| class="prettytable" border="1"<br />
!Add-on Type<br />
!Description<br />
!Media Type Required?<br />
|-<br />
|<code>repository</code><br />
|A repository definition file that allows users to add new repositories to the Kodi addon manager.<br />
|No<br />
|-<br />
|<code>plugin</code><br />
|A plugin script or module that adds to the functionality of Kodi. Plugins appear under the relevant media section of the main home menu.<br />
|'''Yes'''<br />
|-<br />
|<code>script</code><br />
|A runnable program file that will appear in the Program section of the main home menu.<br />
|'''Yes'''<br />
|-<br />
|<code>skin</code><br />
|An Kodi skin definition and its supporting script files.<br />
|No<br />
|-<br />
|<code>resource</code><br />
|An addon that will provide additional files (language files, images, [[sounds.xml|uisounds]]).<br />
|No<br />
|}<br />
<br />
The following table describes the available <code>media-type</code>s for the available add-on types. Your add-on may provide more than one <code>media-type</code> if<br />
you wish, whereby it will appear in more than one section. In most cases, however, a single media type will suffice, and it may be preferable to have multiple add-ons each providing a single media type rather than one add-on that tries to do it all.<br />
<br />
{| class="prettytable" border="1"<br />
!Add-on Type<br />
!Media Type<br />
! Description<br />
|-<br />
|<code>plugin</code><br />
|<code>audio</code><br />
|A music add-on that will appear in the Music main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>video</code><br />
|A video add-on that will appear in the Video main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>picture</code><br />
|A picture add-on that will appear in the Pictures main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>program</code><br />
|A program add-on that will appear in the Add-ons main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>weather</code><br />
|A weather add-on that will appear in the Weather main menu. You can omit the Add-on Type in the directory name and addon-id<br />
|-<br />
|<code>script</code><br />
|<code>module</code><br />
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.<br />
|-<br />
|<code>script</code><br />
|<code>service</code><br />
|A script that will be run at either login or startup<br />
|}<br />
<br />
The add-on name is up to you, but be sure that it isn't already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with Kodi for audio podcasts you might name your directory <code>plugin.audio.gpodder-xbmc3</code>. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be <code>plugin.video.my-great-tv-com</code>. A script to ping all your friends on twitter to tell them you are home might be called<br />
<code>script.service.ping-twits-i-am-home</code>.<br />
<br />
== Directory structure ==<br />
<br />
Your directory contains all the resources needed to operate your add-on. The directory must be considered read-only and should not be used for storing transient or inter-session data. Other mechanisms are available to do that (more later). The directory should be structured as follows:<br />
<br />
=== Kodi v17 Krypton and up===<br />
addon.py<br />
addon.xml<br />
LICENSE.txt<br />
resources/<br />
settings.xml<br />
language/<br />
lib/<br />
data/<br />
media/<br />
fanart.jpg<br />
icon.png<br />
<br />
=== Kodi v16 Jarvis and earlier===<br />
addon.py<br />
addon.xml<br />
fanart.jpg<br />
icon.png<br />
LICENSE.txt<br />
changelog.txt<br />
resources/<br />
settings.xml<br />
language/<br />
lib/<br />
data/<br />
media/<br />
<br />
Other files may be required to run your add-on, if your add-on becomes more complex. It is considered good practice to place various add-on resources and support code modules in the <code>lib/</code> folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. <code>script.module.foo</code>.<br />
<br />
The most important thing to remember from this is that everything that doesn't need to be in the root of your directory is considered a resource and should be placed inside <code>resources/</code> or one of its subdirectories. Also remember, all the above is a ''recommended'' outline for your add-on; if you need fewer or more<br />
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.<br />
<br />
=== addon.py ===<br />
<br />
This will contain the main Python code for your add-on. You can name it whatever you want, since you'll define this Python file in <code>[[addon.xml]]</code> as your main script file.<br />
<br />
=== addon.xml ===<br />
{{See also|addon.xml}}<br />
<br />
<code>addon.xml</code> gives Kodi important metadata about your add-on, such as:<br />
* what the add-on provides<br />
* what the add-on relies on to work<br />
* what script to run when it is fired up (if it is meant to be started)<br />
<br />
<br />
=== changelog.txt ===<br />
<br />
{{note|Deprecated in Kodi v17 Krypton. Replaced by [[Addon.xml#.3Cnews.3E]]}}<br />
<br />
A text file that contains a description of the changes you make to the add-on for each release. This is displayed in the Kodi addon installation/update system. The recommended format is to have it sorted by version in descending order, with a simple description as to the major changes (new functionality, big fixes, etc) in each version. (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<br />
they may have been having has been fixed or not.)<br />
<br />
Here is a sample<br />
<code>changelog.txt:<br />
<br />
v0.1.3 (2015-12-25)<br />
- Update with 15.0 Isengard<br />
<br />
v0.1.2 (2014-1-15)<br />
- Add notification for Ubuntu users checking through apt command<br />
<br />
v0.1.1 (2014-1-1)<br />
- Initial version<br />
</code><br />
<br />
It is recommend to add a date so users know when last update was done. Best is to use YYYY-MM-DD as this is the least confusing way of dat notation.<br />
<br />
=== icon.png ===<br />
<br />
This is an icon used to represent your add-on in various parts of Kodi. In order to keep a coherent look and give the skinner a good idea how the icons of the add-ons look, we have defined the following rules:<br />
<br />
* The icon size must be 256x256 pixels or 512x512 pixels.<br />
* File format is PNG.<br />
* Background must be 100% solid. That doesn't mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.<br />
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.<br />
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).<br />
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.<br />
* Don't mix logos with Kodi's logo; it's obvious that we're talking about Kodi here.<br />
* Don't add borders or any overlays, that's the skinner's job. However, if borders are an element of your logo, make sure there is enough padding.<br />
* It is suggested that a logo on a plain background (non-transparent) is best in many situations (e.g. for addons that retrieve media from an online service, use that service's logo ''as long as you are free to do so'').<br />
* {{note|Kodi v17 Krypton and later}} if this file exists, "icon" must be listed in '''[[Addon.xml#<assets>|addon.xml assets]]'''<br />
<br />
=== fanart.jpg ===<br />
<br />
This helps to keep Kodi graphically rich when browsing and using add-ons. Some simple guidelines:<br />
<br />
* It should be 16:9 aspect ratio<br />
* It is intended for the background, so should be simple and without text where reasonable.<br />
* We recommend a 1280x720 JPEG image. It should certainly be no larger than 1920x1080.<br />
* We recommend keeping it as small as is reasonable with respect to file-size. Remember that hundreds of thousands of users are going to be downloading this.<br />
* {{note|Kodi v17 Krypton and later}} if this file exists, "fanart" must be listed in '''[[Addon.xml#<assets>|addon.xml assets]]'''<br />
<br />
=== LICENSE.txt ===<br />
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}<br />
<br />
This file should contain the text of whatever software license you've chosen to release your add-on under (e.g. GPLv2).<br />
<br />
=== resources/ ===<br />
<br />
The <code>resources/</code> subdirectory is the preferred place to put any files that the add-on uses that don't need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in <code>resources/</code> or one of its subdirectories.<br />
<br />
==== resources/settings.xml ====<br />
{{See also|Add-on settings}}<br />
<br />
This is an XML file that defines the user-configurable settings used by the add-on. The file defines the names and types of the settings, and how they should appear in the settings dialog for the add-on.<br />
<br />
==== resources/language/ ====<br />
<br />
'''Translation tools:'''<br />
* [[Language support]]<br />
* [[Translation System]]<br />
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]<br />
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]<br />
* Utility for keeping Kodi upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]<br />
<br />
<br />
'''String ID range:'''<br />
* strings 31000 thru 31999 reserved for skins<br />
<br />
'''strings.po'''<br />
<br />
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}<br />
<br />
==== resources/lib/ ====<br />
<br />
Put any module definitions or third party software libraries into this directory.<br />
<br />
If you are having errors running the application (e.g. kodi.log shows addon.py isn't found) then a possible cause may be the __init__.pyo & __init__.py files are missing in this folder. Try copying it from another addon.<br />
<br />
==== resources/data/ ====<br />
<br />
Store any other static data structures your application requires here. Examples might be<br />
XLT/XSD files or static XML files that contain lookup tables etc.<br />
<br />
==== resources/media/ ====<br />
<br />
Store any static media (picture, audio, video etc.) files in this directory.<br />
<br />
== Getting started ==<br />
<br />
Following pages will explain in more depth to get started. Providing examples, background information and useful links.<br />
<br />
* [[Python development]]<br />
* [[Skinning]]<br />
<br />
== See also ==<br />
* [[Add-ons]]<br />
* [[:Category:All add-ons]]<br />
* [[3rd party add-on repositories]]<br />
'''Development:'''<br />
* [[Add-on development]]<br />
* [[Addon Settings]]<br />
* [[Python development]]<br />
* [[Skinning]]<br />
* [[Add-on repositories]]<br />
* [[Official add-on repository]]<br />
<br />
[[Category:Add-on development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Add-on_structure&diff=177031Add-on structure2019-08-02T17:41:37Z<p>Leopheard: /* resources/lib/ */</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br />
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC. This system allows third-party developed enhancements to Kodi to be distributed to Kodi users directly from inside the Kodi interface.<br />
<br />
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].<br />
<br />
== Introduction ==<br />
<br />
Each add-on is kept in its own folder, and is described via an XML file named <code>addon.xml</code>. In addition, some other files can also come with the add-on, such as <code>icon.png</code>, <code>changelog.txt</code>, and <code>fanart.jpg</code>. These are all optional, though we encourage you to at least have <code>icon.png</code>. All of these reside in the "root" of the folder that contains the add-on. Additional data may be contained within a <code>resources/</code> subfolder, such as language translations and descriptions of settings.<br />
<br />
When installed, the whole add-on folder will be placed inside <code>.xbmc/addons/</code>.<br />
<br />
== Directory Name ==<br />
<br />
Your directory name should follow this convention: <code><addon-type>[.<media-type>].<your-plugin-name></code><br />
<br />
Each name part is case sensitive and must be in lower case. The dot character separates each name part; you can use further dots to separate things in your plugin name if you wish. Alternatively, you may use a hyphen (-). No other non-alphanumeric characters should be used.<br />
<br />
<code>addon-type</code> is one of the following:<br />
<br />
{| class="prettytable" border="1"<br />
!Add-on Type<br />
!Description<br />
!Media Type Required?<br />
|-<br />
|<code>repository</code><br />
|A repository definition file that allows users to add new repositories to the Kodi addon manager.<br />
|No<br />
|-<br />
|<code>plugin</code><br />
|A plugin script or module that adds to the functionality of Kodi. Plugins appear under the relevant media section of the main home menu.<br />
|'''Yes'''<br />
|-<br />
|<code>script</code><br />
|A runnable program file that will appear in the Program section of the main home menu.<br />
|'''Yes'''<br />
|-<br />
|<code>skin</code><br />
|An Kodi skin definition and its supporting script files.<br />
|No<br />
|-<br />
|<code>resource</code><br />
|An addon that will provide additional files (language files, images, [[sounds.xml|uisounds]]).<br />
|No<br />
|}<br />
<br />
The following table describes the available <code>media-type</code>s for the available add-on types. Your add-on may provide more than one <code>media-type</code> if<br />
you wish, whereby it will appear in more than one section. In most cases, however, a single media type will suffice, and it may be preferable to have multiple add-ons each providing a single media type rather than one add-on that tries to do it all.<br />
<br />
{| class="prettytable" border="1"<br />
!Add-on Type<br />
!Media Type<br />
! Description<br />
|-<br />
|<code>plugin</code><br />
|<code>audio</code><br />
|A music add-on that will appear in the Music main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>video</code><br />
|A video add-on that will appear in the Video main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>picture</code><br />
|A picture add-on that will appear in the Pictures main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>program</code><br />
|A program add-on that will appear in the Add-ons main menu.<br />
|-<br />
|<code>plugin</code><br />
|<code>weather</code><br />
|A weather add-on that will appear in the Weather main menu. You can omit the Add-on Type in the directory name and addon-id<br />
|-<br />
|<code>script</code><br />
|<code>module</code><br />
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.<br />
|-<br />
|<code>script</code><br />
|<code>service</code><br />
|A script that will be run at either login or startup<br />
|}<br />
<br />
The add-on name is up to you, but be sure that it isn't already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with Kodi for audio podcasts you might name your directory <code>plugin.audio.gpodder-xbmc3</code>. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be <code>plugin.video.my-great-tv-com</code>. A script to ping all your friends on twitter to tell them you are home might be called<br />
<code>script.service.ping-twits-i-am-home</code>.<br />
<br />
== Directory structure ==<br />
<br />
Your directory contains all the resources needed to operate your add-on. The directory must be considered read-only and should not be used for storing transient or inter-session data. Other mechanisms are available to do that (more later). The directory should be structured as follows:<br />
<br />
=== Kodi v17 Krypton and up===<br />
addon.py<br />
addon.xml<br />
LICENSE.txt<br />
resources/<br />
settings.xml<br />
language/<br />
lib/<br />
data/<br />
media/<br />
fanart.jpg<br />
icon.png<br />
<br />
=== Kodi v16 Jarvis and earlier===<br />
addon.py<br />
addon.xml<br />
fanart.jpg<br />
icon.png<br />
LICENSE.txt<br />
changelog.txt<br />
resources/<br />
settings.xml<br />
language/<br />
lib/<br />
data/<br />
media/<br />
<br />
Other files may be required to run your add-on, if your add-on becomes more complex. It is considered good practice to place various add-on resources and support code modules in the <code>lib/</code> folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. <code>script.module.foo</code>.<br />
<br />
The most important thing to remember from this is that everything that doesn't need to be in the root of your directory is considered a resource and should be placed inside <code>resources/</code> or one of its subdirectories. Also remember, all the above is a ''recommended'' outline for your add-on; if you need fewer or more<br />
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.<br />
<br />
=== addon.py ===<br />
<br />
This will contain the main Python code for your add-on. You can name it whatever you want, since you'll define this Python file in <code>[[addon.xml]]</code> as your main script file.<br />
<br />
=== addon.xml ===<br />
{{See also|addon.xml}}<br />
<br />
<code>addon.xml</code> gives Kodi important metadata about your add-on, such as:<br />
* what the add-on provides<br />
* what the add-on relies on to work<br />
* what script to run when it is fired up (if it is meant to be started)<br />
<br />
<br />
=== changelog.txt ===<br />
<br />
{{note|Deprecated in Kodi v17 Krypton. Replaced by [[Addon.xml#.3Cnews.3E]]}}<br />
<br />
A text file that contains a description of the changes you make to the add-on for each release. This is displayed in the Kodi addon installation/update system. The recommended format is to have it sorted by version in descending order, with a simple description as to the major changes (new functionality, big fixes, etc) in each version. (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<br />
they may have been having has been fixed or not.)<br />
<br />
Here is a sample<br />
<code>changelog.txt:<br />
<br />
v0.1.3 (2015-12-25)<br />
- Update with 15.0 Isengard<br />
<br />
v0.1.2 (2014-1-15)<br />
- Add notification for Ubuntu users checking through apt command<br />
<br />
v0.1.1 (2014-1-1)<br />
- Initial version<br />
</code><br />
<br />
It is recommend to add a date so users know when last update was done. Best is to use YYYY-MM-DD as this is the least confusing way of dat notation.<br />
<br />
=== icon.png ===<br />
<br />
This is an icon used to represent your add-on in various parts of Kodi. In order to keep a coherent look and give the skinner a good idea how the icons of the add-ons look, we have defined the following rules:<br />
<br />
* The icon size must be 256x256 pixels or 512x512 pixels.<br />
* File format is PNG.<br />
* Background must be 100% solid. That doesn't mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.<br />
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.<br />
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).<br />
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.<br />
* Don't mix logos with Kodi's logo; it's obvious that we're talking about Kodi here.<br />
* Don't add borders or any overlays, that's the skinner's job. However, if borders are an element of your logo, make sure there is enough padding.<br />
* It is suggested that a logo on a plain background (non-transparent) is best in many situations (e.g. for addons that retrieve media from an online service, use that service's logo ''as long as you are free to do so'').<br />
* {{note|Kodi v17 Krypton and later}} if this file exists, "icon" must be listed in '''[[Addon.xml#<assets>|addon.xml assets]]'''<br />
<br />
=== fanart.jpg ===<br />
<br />
This helps to keep Kodi graphically rich when browsing and using add-ons. Some simple guidelines:<br />
<br />
* It should be 16:9 aspect ratio<br />
* It is intended for the background, so should be simple and without text where reasonable.<br />
* We recommend a 1280x720 JPEG image. It should certainly be no larger than 1920x1080.<br />
* We recommend keeping it as small as is reasonable with respect to file-size. Remember that hundreds of thousands of users are going to be downloading this.<br />
* {{note|Kodi v17 Krypton and later}} if this file exists, "fanart" must be listed in '''[[Addon.xml#<assets>|addon.xml assets]]'''<br />
<br />
=== LICENSE.txt ===<br />
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}<br />
<br />
This file should contain the text of whatever software license you've chosen to release your add-on under (e.g. GPLv2).<br />
<br />
=== resources/ ===<br />
<br />
The <code>resources/</code> subdirectory is the preferred place to put any files that the add-on uses that don't need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in <code>resources/</code> or one of its subdirectories.<br />
<br />
==== resources/settings.xml ====<br />
{{See also|Add-on settings}}<br />
<br />
This is an XML file that defines the user-configurable settings used by the add-on. The file defines the names and types of the settings, and how they should appear in the settings dialog for the add-on.<br />
<br />
==== resources/language/ ====<br />
<br />
'''Translation tools:'''<br />
* [[Language support]]<br />
* [[Translation System]]<br />
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]<br />
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]<br />
* Utility for keeping Kodi upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]<br />
<br />
<br />
'''String ID range:'''<br />
* strings 31000 thru 31999 reserved for skins<br />
<br />
'''strings.po'''<br />
<br />
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}<br />
<br />
==== resources/lib/ ====<br />
<br />
Put any module definitions or third party software libraries into this directory.<br />
<br />
If you are having errors running the application (e.g. kodi.log shows addon.py isn't found) then a possible cause may be the __init__.pyo file missing in this folder. Try copying it from another addon.<br />
<br />
==== resources/data/ ====<br />
<br />
Store any other static data structures your application requires here. Examples might be<br />
XLT/XSD files or static XML files that contain lookup tables etc.<br />
<br />
==== resources/media/ ====<br />
<br />
Store any static media (picture, audio, video etc.) files in this directory.<br />
<br />
== Getting started ==<br />
<br />
Following pages will explain in more depth to get started. Providing examples, background information and useful links.<br />
<br />
* [[Python development]]<br />
* [[Skinning]]<br />
<br />
== See also ==<br />
* [[Add-ons]]<br />
* [[:Category:All add-ons]]<br />
* [[3rd party add-on repositories]]<br />
'''Development:'''<br />
* [[Add-on development]]<br />
* [[Addon Settings]]<br />
* [[Python development]]<br />
* [[Skinning]]<br />
* [[Add-on repositories]]<br />
* [[Official add-on repository]]<br />
<br />
[[Category:Add-on development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Addon.xml&diff=177030Addon.xml2019-08-02T17:31:36Z<p>Leopheard: /* Common errors */</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br /><br />
<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.<br />
<br />
Every <code>addon.xml</code> file has the same basic structure, this example is for a video plugin:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You"><br />
<requires><br />
<import addon="xbmc.python" version="2.25.0"/><br />
</requires><br />
<extension point="xbmc.python.pluginsource" library="addon.py"><br />
<provides>video</provides><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en_GB">Your add-on's summary</summary><br />
<description lang="en_GB">Your add-on's description</description><br />
<disclaimer lang="en_GB"></disclaimer><br />
<language>en</language> <!-- the language of the videos the plugin provides, may be left blank --><br />
<platform>all</platform><br />
<license>GPL-2.0</license><br />
<forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be left blank --><br />
<website>http://myplugin.com</website> <!-- the url of the website that contains the videos (or the official website of your plugin). --><br />
<email>you@youremail.com</email> <!-- may be left blank --><br />
<source>http://github.com/you/plugin.addon.id</source><br />
<news>v1.2.3 (01/02/201x)<br />
[new] some new feature<br />
[fix] some fix<br />
</news><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<banner></banner><br />
<clearlogo>resources/clearlogo.png</clearlogo><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
There are a few important things to note in the above sample:<br />
<br />
* The <code><addon></code> element must be present, and be the root node. It presents data about the add-on package as a whole.<br />
* 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.<br />
* Then there are one or more <code><extension></code> elements, each of which describes a part of Kodi that the add-on extends.<br />
* Finally, there is a specific <code><extension></code> element that extends <code>"xbmc.addon.metadata"</code>. This describes the add-on to the user.<br />
* Banners and clearlogos assets exclusive to Kodi v.18+<br />
= Elements =<br />
<br />
== <addon> ==<br />
<br />
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:<br />
<br />
<source lang="xml"><br />
<addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2"><br />
</source><br />
<br />
=== id attribute ===<br />
<br />
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>.<br />
<br />
=== version attribute ===<br />
<br />
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>.<br />
<br />
==== How versioning works ====<br />
<br />
* <code>2.2.9</code> is newer than <code>2.2.1</code><br />
* <code>2.2.10</code> is newer than <code>2.2.1</code><br />
* <code>2.3.0</code> is newer than <code>2.2.9</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~beta</code><br />
* <code>2.2.1~beta</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1~beta3</code> is newer than <code>2.2.1~beta2</code><br />
* <code>2.2.1~beta10</code> is newer than <code>2.2.1~beta1</code><br />
<br />
{{tip|Text should only be added for a beta version. In other cases version number should only contain numbers.}}<br />
<br />
=== name attribute ===<br />
<br />
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.<br />
<br />
=== provider-name attribute ===<br />
<br />
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>).<br />
<br />
== <requires> ==<br />
<br />
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.<br />
<br />
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.<br />
<br />
=== Examples ===<br />
<br />
Here is a sample <code><requires></code> block that imports two required modules:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="xbmc.python" version="2.14.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10"/><br />
</requires><br />
</source><br />
<br />
Here's another example, which will only install on OpenELEC:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="os.openelec.tv" version="2.0"/><br />
</requires><br />
</source><br />
<br />
== <import> ==<br />
<br />
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>.<br />
<br />
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.<br />
<br />
=== addon attribute ===<br />
<br />
The <code>addon</code> attribute specifies the id of the required add-on, e.g. <code>script.module.elementtree</code>.<br />
<br />
=== version attribute ===<br />
<br />
The <code>version</code> attribute specifies the minimum version of the required add-on to be installed.<br />
<br />
==== Dependency versions ====<br />
<br />
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.<br />
<br />
{| class="prettytable" border="1"<br />
|+ Current versions<br />
! Kodi version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon<br />
|-<br />
| Dharma 10.1 <font color="red">Deprecated</font>|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1<br />
|-<br />
| Eden 11.0 <font color="red">Deprecated</font> || 2.0 || 3.0 || 4.0 || 1.0 || 11.0<br />
|-<br />
| Frodo 12.x <font color="red">Deprecated</font>|| 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|}<br />
<br />
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".<br />
<br />
=== optional attribute ===<br />
<br />
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.<br />
<br />
== <extension> ==<br />
<br />
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.<br />
<br />
The various extension points that Kodi provides are given in the list below.<br />
{| class="prettytable"<br />
!Extension point<br />
!Add-on Category<br />
|-<br />
|<code>[[Skinning|xbmc.gui.skin]]</code><br />
|Skin<br />
|-<br />
|<code>xbmc.webinterface</code><br />
|Web interface<br />
|-<br />
|<code>[[Add-on repositories|xbmc.addon.repository]]</code><br />
|''None''<br />
|-<br />
|<code>[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]</code><br />
|Services<br />
|-<br />
|<code>xbmc.metadata.scraper.albums</code><br />
|Album information<br />
|-<br />
|<code>xbmc.metadata.scraper.artists</code><br />
|Artist information<br />
|-<br />
|<code>xbmc.metadata.scraper.movies</code><br />
|Movie information<br />
|-<br />
|<code>xbmc.metadata.scraper.musicvideos</code><br />
|Music video information<br />
|-<br />
|<code>xbmc.metadata.scraper.tvshows</code><br />
|TV information<br />
|-<br />
|<code>xbmc.metadata.scraper.library</code><br />
|''None''<br />
|-<br />
|<code>xbmc.ui.screensaver</code><br />
|Screensaver<br />
|-<br />
|<code>xbmc.player.musicviz</code><br />
|Visualization<br />
|-<br />
|<code>[[Plugin sources#What Kodi requires for your add-on|xbmc.python.pluginsource]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>[[Script sources#What Kodi requires for your add-on|xbmc.python.script]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>xbmc.python.weather</code><br />
|Weather<br />
|-<br />
|<code>xbmc.subtitle.module</code><br />
|Subtitle service module<br />
|-<br />
|<code>[[Script lyrics#What Kodi requires for your add-on|xbmc.python.lyrics]]</code><br />
|Lyrics<br />
|-<br />
|<code>[[Script library#What Kodi requires for your add-on|xbmc.python.library]]</code><br />
|''None''<br />
|-<br />
|<code>xbmc.python.module</code><br />
|These don't show up in the addon browser and are purely as support for other scripts.<br />
|-<br />
|<code>xbmc.addon.video</code><br />
|Video Add-ons (video)<br />
|-<br />
|<code>xbmc.addon.audio</code><br />
|Music Add-ons (audio)<br />
|-<br />
|<code>xbmc.addon.image</code><br />
|Picture Add-ons (image)<br />
|-<br />
|<code>kodi.resource.images</code><br />
|Additional image files<br />
|-<br />
|<code>kodi.resource.language</code><br />
|Additional language files<br />
|}<br />
<br />
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.<br />
<br />
=== xbmc.python.pluginsource ===<br />
{{See also|Plugin sources}}<br />
<br />
The most common extension point that will be used by plugin addon developers is <code>xbmc.python.pluginsource</code>.<br />
<br />
==== library attribute ====<br />
<br />
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.<br />
<br />
==== <provides> element ====<br />
<br />
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):<br />
<br />
{| class="prettytable"<br />
!Provides<br />
!Appears in<br />
|-<br />
|<code>image</code><br />
|Pictures<br />
|-<br />
|<code>audio</code><br />
|Music<br />
|-<br />
|<code>video</code><br />
|Video<br />
|-<br />
|<code>executable</code><br />
|Programs<br />
|-<br />
|''(blank)''<br />
|Not visible<br />
|}<br />
<br />
==== Example ====<br />
<br />
<source lang="xml"><br />
<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py"><br />
<provides>audio video</provides><br />
</extension><br />
</source><br />
<br />
=== xbmc.addon.metadata ===<br />
<br />
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.<br />
<br />
==== Required elements ====<br />
<br />
There are several elements that this should contain and all are compulsory (except the broken tag). Each of the elements below must always be present in English as a minimum.<br />
<br />
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)]]).<br />
<br />
===== <summary> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary><br />
</source><br />
<br />
===== <description> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<description lang="en_GB">Hello World script provides some basic examples on how to create your first script<br />
and hopefully will increase the number of Kodi users to start creating their own addons.</description><br />
</source><br />
<br />
===== <disclaimer> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer><br />
</source><br />
<br />
===== <news> =====<br />
<br />
{{note|Used in Kodi v17 Krypton and later only. Older versions are forward compatible.}}<br />
<br />
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.)<br />
Please keep it short (it's limited to 1500 characters), you might want to only include the changes for the last version here.<br />
<br />
Here is an example: <br />
<br />
<source lang="xml"><br />
<news>v0.1.2 (2014-1-15)<br />
- Added notification for Ubuntu users checking through apt command</news><br />
</source><br />
<br />
===== <platform> =====<br />
<br />
The <code><platform></code> tag specifies which platforms (operating systems, hardware) 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:<br />
<br />
* <code>all</code><br />
* <code>linux</code><br />
* <code>osx</code><br />
* <code>osx64</code><br />
* <code>osx32</code><br />
* <code>ios</code><br />
* <code>windx</code><br />
* <code>android</code><br />
<br />
<source lang="xml"><br />
<platform>all</platform><br />
</source><br />
<br />
===== <language> =====<br />
<br />
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, leave it blank.<br />
<br />
<source lang="xml"><br />
<language>en de fr</language><br />
or<br />
<language></language><br />
</source><br />
<br />
===== <license> =====<br />
<br />
The <code><license></code> element indicates what license is used for this add-on.<br />
<br />
<source lang="xml"><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
</source><br />
<br />
===== <forum> =====<br />
<br />
The <code><forum></code> element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.<br />
<source lang="xml"><br />
<forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum><br />
</source><br />
<br />
===== <website> =====<br />
<br />
The <code><website></code> element provides the website URL for this specific add-on.<br />
<br />
<source lang="xml"><br />
<website>http://www.myaddonwebsite.com/</website><br />
</source><br />
<br />
===== <nowiki><source></nowiki> =====<br />
<br />
The <code><nowiki><source></nowiki></code> element provides the URL for the source code for this specific add-on.<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<source>http://github.com/someone/myaddon</source><br />
</syntaxhighlight><br />
<br />
===== <email> =====<br />
<br />
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.<br />
<source lang="xml"><br />
<email>foo@bar.com</email><br />
or<br />
<email>foo at bar dot com</email><br />
</source><br />
<br />
===== <broken> =====<br />
<br />
The <code><broken></code> tag will mark the add-on as broken in the Kodi repo and provide the reason why. It is recommended to also add some more information in the changelog.<br />
<br />
<source lang="xml"><br />
<broken>deprecated</broken><br />
</source><br />
<br />
===== <assets> =====<br />
<br />
{{note|Kodi v17 Krypton and later.}}<br />
<br />
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:<br />
<br />
* <code><icon></code> See [[Add-on_structure#icon.png]] - if an icon.png file exists it must be listed here<br />
* <code><fanart></code> See [[Add-on_structure#fanart.jpg]] - if a fanart.jpg file exists it must be listed here<br />
* <code><screenshot></code><br />
<br />
If some elements are empty or not specified, it will be treated as non-existing/not provided.<br />
<br />
Example:<br />
<source lang="xml"><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<screenshot>resources/screenshot-01.jpg</screenshot><br />
<screenshot>resources/screenshot-02.jpg</screenshot><br />
<screenshot>resources/screenshot-03.jpg</screenshot><br />
<screenshot>resources/screenshot-04.jpg</screenshot><br />
</assets><br />
</source><br />
<br />
With the above example definition, the files must be placed in the <code>resources</code> folder.<br />
<br />
== Skin specific elements ==<br />
=== Overview ===<br />
{| class="prettytable"<br />
| '''effectslowdown'''<br />
| 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.<br />
|- <br />
| '''debugging'''<br />
| When set to true, it'll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.<br />
|- <br />
| '''res'''<br />
| Support for arbitrary skin resolutions.<br />
|}<br />
<br />
=== How window xml files are found ===<br />
<br />
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.<br />
<br />
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).<br />
<br />
The order that Kodi looks for it's skin files are as follows:<br />
<br />
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)<br />
# If the current screenmode is 1080i and there's no 1080i folder, it then looks in the 720p folder.<br />
# Finally, it looks in the '''res''' folder.<br />
<br />
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.<br />
<br />
= Examples =<br />
<br />
== addon.xml for skins ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<addon<br />
id="skin.confluence"<br />
version="2.1.3"<br />
name="Confluence"<br />
provider-name="Jezz_X, Team Kodi"><br />
<requires><br />
<import addon="xbmc.gui" version="5.13.0"/><br />
</requires><br />
<extension<br />
point="xbmc.gui.skin"<br />
debugging="false"<br />
effectslowdown="0.75"><br />
<res width="1280" height="720" aspect="16:9" default="true" folder="720p" /><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Confluence skin by Jezz_X. (Kodi's default skin)</summary><br />
<description lang="en">Confluence is the default skin for Kodi 9.11 and above. It is a combination of concepts from many popular skins, and attempts to embrace and integrate their good ideas into a skin that should be easy for first time Kodi users to understand and use.</description><br />
<disclaimer lang="en">Confluence is the default skin for Kodi, removing it may cause issues</disclaimer><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
One thing to note is that <font color="red">all tag names are lower case.</font> XML tag names are case sensitive!<br />
<br />
== addon.xml for scripts ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon<br />
id="script.artwork.downloader"<br />
name="Artwork Downloader"<br />
version="12.0.12"<br />
provider-name="Martijn"><br />
<requires><br />
<import addon="xbmc.python" version="2.1.0"/><br />
<import addon="xbmc.json" version="6.0.0"/><br />
<import addon="xbmc.addon" version="12.0.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10" optional="true"/><br />
<import addon="script.common.plugin.cache" version="1.3.0"/><br />
</requires><br />
<extension point="xbmc.python.script" library="default.py"><br />
<provides>executable</provides><br />
</extension><br />
<extension point="xbmc.service" library="service.py" start="login"/><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary><br />
<description lang="en">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><br />
<disclaimer lang="en">For bugs, requests or general questions visit the Artwork Downloader thread on the Kodi forum.</disclaimer><br />
<language></language><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
=== Common errors ===<br />
<br />
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:<br />
<br />
# Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc<br />
# Too large description can sometimes cause issues<br />
# You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description><br />
# 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):<br />
* .kodi/addons/temp<br />
* .kodi/temp/temp<br />
* .kodi/temp/archive_cache<br />
<br />
= Schema Definition =<br />
<br />
The XML schema definition for <code>addon.xml</code> is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].<br />
<br />
{{Krypton updated}}<br />
<br />
[[Category:Add-on development]]<br />
[[Category:Skin development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Addon.xml&diff=177029Addon.xml2019-08-02T17:30:56Z<p>Leopheard: /* Common errors */</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br /><br />
<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.<br />
<br />
Every <code>addon.xml</code> file has the same basic structure, this example is for a video plugin:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You"><br />
<requires><br />
<import addon="xbmc.python" version="2.25.0"/><br />
</requires><br />
<extension point="xbmc.python.pluginsource" library="addon.py"><br />
<provides>video</provides><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en_GB">Your add-on's summary</summary><br />
<description lang="en_GB">Your add-on's description</description><br />
<disclaimer lang="en_GB"></disclaimer><br />
<language>en</language> <!-- the language of the videos the plugin provides, may be left blank --><br />
<platform>all</platform><br />
<license>GPL-2.0</license><br />
<forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be left blank --><br />
<website>http://myplugin.com</website> <!-- the url of the website that contains the videos (or the official website of your plugin). --><br />
<email>you@youremail.com</email> <!-- may be left blank --><br />
<source>http://github.com/you/plugin.addon.id</source><br />
<news>v1.2.3 (01/02/201x)<br />
[new] some new feature<br />
[fix] some fix<br />
</news><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<banner></banner><br />
<clearlogo>resources/clearlogo.png</clearlogo><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
There are a few important things to note in the above sample:<br />
<br />
* The <code><addon></code> element must be present, and be the root node. It presents data about the add-on package as a whole.<br />
* 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.<br />
* Then there are one or more <code><extension></code> elements, each of which describes a part of Kodi that the add-on extends.<br />
* Finally, there is a specific <code><extension></code> element that extends <code>"xbmc.addon.metadata"</code>. This describes the add-on to the user.<br />
* Banners and clearlogos assets exclusive to Kodi v.18+<br />
= Elements =<br />
<br />
== <addon> ==<br />
<br />
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:<br />
<br />
<source lang="xml"><br />
<addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2"><br />
</source><br />
<br />
=== id attribute ===<br />
<br />
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>.<br />
<br />
=== version attribute ===<br />
<br />
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>.<br />
<br />
==== How versioning works ====<br />
<br />
* <code>2.2.9</code> is newer than <code>2.2.1</code><br />
* <code>2.2.10</code> is newer than <code>2.2.1</code><br />
* <code>2.3.0</code> is newer than <code>2.2.9</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~beta</code><br />
* <code>2.2.1~beta</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1~beta3</code> is newer than <code>2.2.1~beta2</code><br />
* <code>2.2.1~beta10</code> is newer than <code>2.2.1~beta1</code><br />
<br />
{{tip|Text should only be added for a beta version. In other cases version number should only contain numbers.}}<br />
<br />
=== name attribute ===<br />
<br />
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.<br />
<br />
=== provider-name attribute ===<br />
<br />
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>).<br />
<br />
== <requires> ==<br />
<br />
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.<br />
<br />
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.<br />
<br />
=== Examples ===<br />
<br />
Here is a sample <code><requires></code> block that imports two required modules:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="xbmc.python" version="2.14.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10"/><br />
</requires><br />
</source><br />
<br />
Here's another example, which will only install on OpenELEC:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="os.openelec.tv" version="2.0"/><br />
</requires><br />
</source><br />
<br />
== <import> ==<br />
<br />
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>.<br />
<br />
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.<br />
<br />
=== addon attribute ===<br />
<br />
The <code>addon</code> attribute specifies the id of the required add-on, e.g. <code>script.module.elementtree</code>.<br />
<br />
=== version attribute ===<br />
<br />
The <code>version</code> attribute specifies the minimum version of the required add-on to be installed.<br />
<br />
==== Dependency versions ====<br />
<br />
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.<br />
<br />
{| class="prettytable" border="1"<br />
|+ Current versions<br />
! Kodi version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon<br />
|-<br />
| Dharma 10.1 <font color="red">Deprecated</font>|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1<br />
|-<br />
| Eden 11.0 <font color="red">Deprecated</font> || 2.0 || 3.0 || 4.0 || 1.0 || 11.0<br />
|-<br />
| Frodo 12.x <font color="red">Deprecated</font>|| 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|}<br />
<br />
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".<br />
<br />
=== optional attribute ===<br />
<br />
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.<br />
<br />
== <extension> ==<br />
<br />
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.<br />
<br />
The various extension points that Kodi provides are given in the list below.<br />
{| class="prettytable"<br />
!Extension point<br />
!Add-on Category<br />
|-<br />
|<code>[[Skinning|xbmc.gui.skin]]</code><br />
|Skin<br />
|-<br />
|<code>xbmc.webinterface</code><br />
|Web interface<br />
|-<br />
|<code>[[Add-on repositories|xbmc.addon.repository]]</code><br />
|''None''<br />
|-<br />
|<code>[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]</code><br />
|Services<br />
|-<br />
|<code>xbmc.metadata.scraper.albums</code><br />
|Album information<br />
|-<br />
|<code>xbmc.metadata.scraper.artists</code><br />
|Artist information<br />
|-<br />
|<code>xbmc.metadata.scraper.movies</code><br />
|Movie information<br />
|-<br />
|<code>xbmc.metadata.scraper.musicvideos</code><br />
|Music video information<br />
|-<br />
|<code>xbmc.metadata.scraper.tvshows</code><br />
|TV information<br />
|-<br />
|<code>xbmc.metadata.scraper.library</code><br />
|''None''<br />
|-<br />
|<code>xbmc.ui.screensaver</code><br />
|Screensaver<br />
|-<br />
|<code>xbmc.player.musicviz</code><br />
|Visualization<br />
|-<br />
|<code>[[Plugin sources#What Kodi requires for your add-on|xbmc.python.pluginsource]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>[[Script sources#What Kodi requires for your add-on|xbmc.python.script]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>xbmc.python.weather</code><br />
|Weather<br />
|-<br />
|<code>xbmc.subtitle.module</code><br />
|Subtitle service module<br />
|-<br />
|<code>[[Script lyrics#What Kodi requires for your add-on|xbmc.python.lyrics]]</code><br />
|Lyrics<br />
|-<br />
|<code>[[Script library#What Kodi requires for your add-on|xbmc.python.library]]</code><br />
|''None''<br />
|-<br />
|<code>xbmc.python.module</code><br />
|These don't show up in the addon browser and are purely as support for other scripts.<br />
|-<br />
|<code>xbmc.addon.video</code><br />
|Video Add-ons (video)<br />
|-<br />
|<code>xbmc.addon.audio</code><br />
|Music Add-ons (audio)<br />
|-<br />
|<code>xbmc.addon.image</code><br />
|Picture Add-ons (image)<br />
|-<br />
|<code>kodi.resource.images</code><br />
|Additional image files<br />
|-<br />
|<code>kodi.resource.language</code><br />
|Additional language files<br />
|}<br />
<br />
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.<br />
<br />
=== xbmc.python.pluginsource ===<br />
{{See also|Plugin sources}}<br />
<br />
The most common extension point that will be used by plugin addon developers is <code>xbmc.python.pluginsource</code>.<br />
<br />
==== library attribute ====<br />
<br />
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.<br />
<br />
==== <provides> element ====<br />
<br />
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):<br />
<br />
{| class="prettytable"<br />
!Provides<br />
!Appears in<br />
|-<br />
|<code>image</code><br />
|Pictures<br />
|-<br />
|<code>audio</code><br />
|Music<br />
|-<br />
|<code>video</code><br />
|Video<br />
|-<br />
|<code>executable</code><br />
|Programs<br />
|-<br />
|''(blank)''<br />
|Not visible<br />
|}<br />
<br />
==== Example ====<br />
<br />
<source lang="xml"><br />
<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py"><br />
<provides>audio video</provides><br />
</extension><br />
</source><br />
<br />
=== xbmc.addon.metadata ===<br />
<br />
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.<br />
<br />
==== Required elements ====<br />
<br />
There are several elements that this should contain and all are compulsory (except the broken tag). Each of the elements below must always be present in English as a minimum.<br />
<br />
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)]]).<br />
<br />
===== <summary> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary><br />
</source><br />
<br />
===== <description> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<description lang="en_GB">Hello World script provides some basic examples on how to create your first script<br />
and hopefully will increase the number of Kodi users to start creating their own addons.</description><br />
</source><br />
<br />
===== <disclaimer> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer><br />
</source><br />
<br />
===== <news> =====<br />
<br />
{{note|Used in Kodi v17 Krypton and later only. Older versions are forward compatible.}}<br />
<br />
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.)<br />
Please keep it short (it's limited to 1500 characters), you might want to only include the changes for the last version here.<br />
<br />
Here is an example: <br />
<br />
<source lang="xml"><br />
<news>v0.1.2 (2014-1-15)<br />
- Added notification for Ubuntu users checking through apt command</news><br />
</source><br />
<br />
===== <platform> =====<br />
<br />
The <code><platform></code> tag specifies which platforms (operating systems, hardware) 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:<br />
<br />
* <code>all</code><br />
* <code>linux</code><br />
* <code>osx</code><br />
* <code>osx64</code><br />
* <code>osx32</code><br />
* <code>ios</code><br />
* <code>windx</code><br />
* <code>android</code><br />
<br />
<source lang="xml"><br />
<platform>all</platform><br />
</source><br />
<br />
===== <language> =====<br />
<br />
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, leave it blank.<br />
<br />
<source lang="xml"><br />
<language>en de fr</language><br />
or<br />
<language></language><br />
</source><br />
<br />
===== <license> =====<br />
<br />
The <code><license></code> element indicates what license is used for this add-on.<br />
<br />
<source lang="xml"><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
</source><br />
<br />
===== <forum> =====<br />
<br />
The <code><forum></code> element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.<br />
<source lang="xml"><br />
<forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum><br />
</source><br />
<br />
===== <website> =====<br />
<br />
The <code><website></code> element provides the website URL for this specific add-on.<br />
<br />
<source lang="xml"><br />
<website>http://www.myaddonwebsite.com/</website><br />
</source><br />
<br />
===== <nowiki><source></nowiki> =====<br />
<br />
The <code><nowiki><source></nowiki></code> element provides the URL for the source code for this specific add-on.<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<source>http://github.com/someone/myaddon</source><br />
</syntaxhighlight><br />
<br />
===== <email> =====<br />
<br />
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.<br />
<source lang="xml"><br />
<email>foo@bar.com</email><br />
or<br />
<email>foo at bar dot com</email><br />
</source><br />
<br />
===== <broken> =====<br />
<br />
The <code><broken></code> tag will mark the add-on as broken in the Kodi repo and provide the reason why. It is recommended to also add some more information in the changelog.<br />
<br />
<source lang="xml"><br />
<broken>deprecated</broken><br />
</source><br />
<br />
===== <assets> =====<br />
<br />
{{note|Kodi v17 Krypton and later.}}<br />
<br />
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:<br />
<br />
* <code><icon></code> See [[Add-on_structure#icon.png]] - if an icon.png file exists it must be listed here<br />
* <code><fanart></code> See [[Add-on_structure#fanart.jpg]] - if a fanart.jpg file exists it must be listed here<br />
* <code><screenshot></code><br />
<br />
If some elements are empty or not specified, it will be treated as non-existing/not provided.<br />
<br />
Example:<br />
<source lang="xml"><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<screenshot>resources/screenshot-01.jpg</screenshot><br />
<screenshot>resources/screenshot-02.jpg</screenshot><br />
<screenshot>resources/screenshot-03.jpg</screenshot><br />
<screenshot>resources/screenshot-04.jpg</screenshot><br />
</assets><br />
</source><br />
<br />
With the above example definition, the files must be placed in the <code>resources</code> folder.<br />
<br />
== Skin specific elements ==<br />
=== Overview ===<br />
{| class="prettytable"<br />
| '''effectslowdown'''<br />
| 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.<br />
|- <br />
| '''debugging'''<br />
| When set to true, it'll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.<br />
|- <br />
| '''res'''<br />
| Support for arbitrary skin resolutions.<br />
|}<br />
<br />
=== How window xml files are found ===<br />
<br />
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.<br />
<br />
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).<br />
<br />
The order that Kodi looks for it's skin files are as follows:<br />
<br />
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)<br />
# If the current screenmode is 1080i and there's no 1080i folder, it then looks in the 720p folder.<br />
# Finally, it looks in the '''res''' folder.<br />
<br />
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.<br />
<br />
= Examples =<br />
<br />
== addon.xml for skins ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<addon<br />
id="skin.confluence"<br />
version="2.1.3"<br />
name="Confluence"<br />
provider-name="Jezz_X, Team Kodi"><br />
<requires><br />
<import addon="xbmc.gui" version="5.13.0"/><br />
</requires><br />
<extension<br />
point="xbmc.gui.skin"<br />
debugging="false"<br />
effectslowdown="0.75"><br />
<res width="1280" height="720" aspect="16:9" default="true" folder="720p" /><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Confluence skin by Jezz_X. (Kodi's default skin)</summary><br />
<description lang="en">Confluence is the default skin for Kodi 9.11 and above. It is a combination of concepts from many popular skins, and attempts to embrace and integrate their good ideas into a skin that should be easy for first time Kodi users to understand and use.</description><br />
<disclaimer lang="en">Confluence is the default skin for Kodi, removing it may cause issues</disclaimer><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
One thing to note is that <font color="red">all tag names are lower case.</font> XML tag names are case sensitive!<br />
<br />
== addon.xml for scripts ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon<br />
id="script.artwork.downloader"<br />
name="Artwork Downloader"<br />
version="12.0.12"<br />
provider-name="Martijn"><br />
<requires><br />
<import addon="xbmc.python" version="2.1.0"/><br />
<import addon="xbmc.json" version="6.0.0"/><br />
<import addon="xbmc.addon" version="12.0.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10" optional="true"/><br />
<import addon="script.common.plugin.cache" version="1.3.0"/><br />
</requires><br />
<extension point="xbmc.python.script" library="default.py"><br />
<provides>executable</provides><br />
</extension><br />
<extension point="xbmc.service" library="service.py" start="login"/><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary><br />
<description lang="en">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><br />
<disclaimer lang="en">For bugs, requests or general questions visit the Artwork Downloader thread on the Kodi forum.</disclaimer><br />
<language></language><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
=== Common errors ===<br />
<br />
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:<br />
<br />
# Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc<br />
# Too large description can sometimes cause issues<br />
# You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description><br />
# 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:<br />
* .kodi/addons/temp<br />
* .kodi/temp/temp<br />
* .kodi/temp/archive_cache<br />
# Sometimes the only way to install a fixed addon is also reboot your Kodi device entirely<br />
<br />
= Schema Definition =<br />
<br />
The XML schema definition for <code>addon.xml</code> is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].<br />
<br />
{{Krypton updated}}<br />
<br />
[[Category:Add-on development]]<br />
[[Category:Skin development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Addon.xml&diff=177028Addon.xml2019-08-02T17:30:06Z<p>Leopheard: formatting</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br /><br />
<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.<br />
<br />
Every <code>addon.xml</code> file has the same basic structure, this example is for a video plugin:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You"><br />
<requires><br />
<import addon="xbmc.python" version="2.25.0"/><br />
</requires><br />
<extension point="xbmc.python.pluginsource" library="addon.py"><br />
<provides>video</provides><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en_GB">Your add-on's summary</summary><br />
<description lang="en_GB">Your add-on's description</description><br />
<disclaimer lang="en_GB"></disclaimer><br />
<language>en</language> <!-- the language of the videos the plugin provides, may be left blank --><br />
<platform>all</platform><br />
<license>GPL-2.0</license><br />
<forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be left blank --><br />
<website>http://myplugin.com</website> <!-- the url of the website that contains the videos (or the official website of your plugin). --><br />
<email>you@youremail.com</email> <!-- may be left blank --><br />
<source>http://github.com/you/plugin.addon.id</source><br />
<news>v1.2.3 (01/02/201x)<br />
[new] some new feature<br />
[fix] some fix<br />
</news><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<banner></banner><br />
<clearlogo>resources/clearlogo.png</clearlogo><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
There are a few important things to note in the above sample:<br />
<br />
* The <code><addon></code> element must be present, and be the root node. It presents data about the add-on package as a whole.<br />
* 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.<br />
* Then there are one or more <code><extension></code> elements, each of which describes a part of Kodi that the add-on extends.<br />
* Finally, there is a specific <code><extension></code> element that extends <code>"xbmc.addon.metadata"</code>. This describes the add-on to the user.<br />
* Banners and clearlogos assets exclusive to Kodi v.18+<br />
= Elements =<br />
<br />
== <addon> ==<br />
<br />
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:<br />
<br />
<source lang="xml"><br />
<addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2"><br />
</source><br />
<br />
=== id attribute ===<br />
<br />
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>.<br />
<br />
=== version attribute ===<br />
<br />
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>.<br />
<br />
==== How versioning works ====<br />
<br />
* <code>2.2.9</code> is newer than <code>2.2.1</code><br />
* <code>2.2.10</code> is newer than <code>2.2.1</code><br />
* <code>2.3.0</code> is newer than <code>2.2.9</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~beta</code><br />
* <code>2.2.1~beta</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1~beta3</code> is newer than <code>2.2.1~beta2</code><br />
* <code>2.2.1~beta10</code> is newer than <code>2.2.1~beta1</code><br />
<br />
{{tip|Text should only be added for a beta version. In other cases version number should only contain numbers.}}<br />
<br />
=== name attribute ===<br />
<br />
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.<br />
<br />
=== provider-name attribute ===<br />
<br />
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>).<br />
<br />
== <requires> ==<br />
<br />
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.<br />
<br />
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.<br />
<br />
=== Examples ===<br />
<br />
Here is a sample <code><requires></code> block that imports two required modules:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="xbmc.python" version="2.14.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10"/><br />
</requires><br />
</source><br />
<br />
Here's another example, which will only install on OpenELEC:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="os.openelec.tv" version="2.0"/><br />
</requires><br />
</source><br />
<br />
== <import> ==<br />
<br />
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>.<br />
<br />
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.<br />
<br />
=== addon attribute ===<br />
<br />
The <code>addon</code> attribute specifies the id of the required add-on, e.g. <code>script.module.elementtree</code>.<br />
<br />
=== version attribute ===<br />
<br />
The <code>version</code> attribute specifies the minimum version of the required add-on to be installed.<br />
<br />
==== Dependency versions ====<br />
<br />
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.<br />
<br />
{| class="prettytable" border="1"<br />
|+ Current versions<br />
! Kodi version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon<br />
|-<br />
| Dharma 10.1 <font color="red">Deprecated</font>|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1<br />
|-<br />
| Eden 11.0 <font color="red">Deprecated</font> || 2.0 || 3.0 || 4.0 || 1.0 || 11.0<br />
|-<br />
| Frodo 12.x <font color="red">Deprecated</font>|| 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|}<br />
<br />
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".<br />
<br />
=== optional attribute ===<br />
<br />
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.<br />
<br />
== <extension> ==<br />
<br />
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.<br />
<br />
The various extension points that Kodi provides are given in the list below.<br />
{| class="prettytable"<br />
!Extension point<br />
!Add-on Category<br />
|-<br />
|<code>[[Skinning|xbmc.gui.skin]]</code><br />
|Skin<br />
|-<br />
|<code>xbmc.webinterface</code><br />
|Web interface<br />
|-<br />
|<code>[[Add-on repositories|xbmc.addon.repository]]</code><br />
|''None''<br />
|-<br />
|<code>[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]</code><br />
|Services<br />
|-<br />
|<code>xbmc.metadata.scraper.albums</code><br />
|Album information<br />
|-<br />
|<code>xbmc.metadata.scraper.artists</code><br />
|Artist information<br />
|-<br />
|<code>xbmc.metadata.scraper.movies</code><br />
|Movie information<br />
|-<br />
|<code>xbmc.metadata.scraper.musicvideos</code><br />
|Music video information<br />
|-<br />
|<code>xbmc.metadata.scraper.tvshows</code><br />
|TV information<br />
|-<br />
|<code>xbmc.metadata.scraper.library</code><br />
|''None''<br />
|-<br />
|<code>xbmc.ui.screensaver</code><br />
|Screensaver<br />
|-<br />
|<code>xbmc.player.musicviz</code><br />
|Visualization<br />
|-<br />
|<code>[[Plugin sources#What Kodi requires for your add-on|xbmc.python.pluginsource]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>[[Script sources#What Kodi requires for your add-on|xbmc.python.script]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>xbmc.python.weather</code><br />
|Weather<br />
|-<br />
|<code>xbmc.subtitle.module</code><br />
|Subtitle service module<br />
|-<br />
|<code>[[Script lyrics#What Kodi requires for your add-on|xbmc.python.lyrics]]</code><br />
|Lyrics<br />
|-<br />
|<code>[[Script library#What Kodi requires for your add-on|xbmc.python.library]]</code><br />
|''None''<br />
|-<br />
|<code>xbmc.python.module</code><br />
|These don't show up in the addon browser and are purely as support for other scripts.<br />
|-<br />
|<code>xbmc.addon.video</code><br />
|Video Add-ons (video)<br />
|-<br />
|<code>xbmc.addon.audio</code><br />
|Music Add-ons (audio)<br />
|-<br />
|<code>xbmc.addon.image</code><br />
|Picture Add-ons (image)<br />
|-<br />
|<code>kodi.resource.images</code><br />
|Additional image files<br />
|-<br />
|<code>kodi.resource.language</code><br />
|Additional language files<br />
|}<br />
<br />
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.<br />
<br />
=== xbmc.python.pluginsource ===<br />
{{See also|Plugin sources}}<br />
<br />
The most common extension point that will be used by plugin addon developers is <code>xbmc.python.pluginsource</code>.<br />
<br />
==== library attribute ====<br />
<br />
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.<br />
<br />
==== <provides> element ====<br />
<br />
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):<br />
<br />
{| class="prettytable"<br />
!Provides<br />
!Appears in<br />
|-<br />
|<code>image</code><br />
|Pictures<br />
|-<br />
|<code>audio</code><br />
|Music<br />
|-<br />
|<code>video</code><br />
|Video<br />
|-<br />
|<code>executable</code><br />
|Programs<br />
|-<br />
|''(blank)''<br />
|Not visible<br />
|}<br />
<br />
==== Example ====<br />
<br />
<source lang="xml"><br />
<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py"><br />
<provides>audio video</provides><br />
</extension><br />
</source><br />
<br />
=== xbmc.addon.metadata ===<br />
<br />
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.<br />
<br />
==== Required elements ====<br />
<br />
There are several elements that this should contain and all are compulsory (except the broken tag). Each of the elements below must always be present in English as a minimum.<br />
<br />
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)]]).<br />
<br />
===== <summary> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary><br />
</source><br />
<br />
===== <description> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<description lang="en_GB">Hello World script provides some basic examples on how to create your first script<br />
and hopefully will increase the number of Kodi users to start creating their own addons.</description><br />
</source><br />
<br />
===== <disclaimer> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer><br />
</source><br />
<br />
===== <news> =====<br />
<br />
{{note|Used in Kodi v17 Krypton and later only. Older versions are forward compatible.}}<br />
<br />
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.)<br />
Please keep it short (it's limited to 1500 characters), you might want to only include the changes for the last version here.<br />
<br />
Here is an example: <br />
<br />
<source lang="xml"><br />
<news>v0.1.2 (2014-1-15)<br />
- Added notification for Ubuntu users checking through apt command</news><br />
</source><br />
<br />
===== <platform> =====<br />
<br />
The <code><platform></code> tag specifies which platforms (operating systems, hardware) 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:<br />
<br />
* <code>all</code><br />
* <code>linux</code><br />
* <code>osx</code><br />
* <code>osx64</code><br />
* <code>osx32</code><br />
* <code>ios</code><br />
* <code>windx</code><br />
* <code>android</code><br />
<br />
<source lang="xml"><br />
<platform>all</platform><br />
</source><br />
<br />
===== <language> =====<br />
<br />
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, leave it blank.<br />
<br />
<source lang="xml"><br />
<language>en de fr</language><br />
or<br />
<language></language><br />
</source><br />
<br />
===== <license> =====<br />
<br />
The <code><license></code> element indicates what license is used for this add-on.<br />
<br />
<source lang="xml"><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
</source><br />
<br />
===== <forum> =====<br />
<br />
The <code><forum></code> element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.<br />
<source lang="xml"><br />
<forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum><br />
</source><br />
<br />
===== <website> =====<br />
<br />
The <code><website></code> element provides the website URL for this specific add-on.<br />
<br />
<source lang="xml"><br />
<website>http://www.myaddonwebsite.com/</website><br />
</source><br />
<br />
===== <nowiki><source></nowiki> =====<br />
<br />
The <code><nowiki><source></nowiki></code> element provides the URL for the source code for this specific add-on.<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<source>http://github.com/someone/myaddon</source><br />
</syntaxhighlight><br />
<br />
===== <email> =====<br />
<br />
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.<br />
<source lang="xml"><br />
<email>foo@bar.com</email><br />
or<br />
<email>foo at bar dot com</email><br />
</source><br />
<br />
===== <broken> =====<br />
<br />
The <code><broken></code> tag will mark the add-on as broken in the Kodi repo and provide the reason why. It is recommended to also add some more information in the changelog.<br />
<br />
<source lang="xml"><br />
<broken>deprecated</broken><br />
</source><br />
<br />
===== <assets> =====<br />
<br />
{{note|Kodi v17 Krypton and later.}}<br />
<br />
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:<br />
<br />
* <code><icon></code> See [[Add-on_structure#icon.png]] - if an icon.png file exists it must be listed here<br />
* <code><fanart></code> See [[Add-on_structure#fanart.jpg]] - if a fanart.jpg file exists it must be listed here<br />
* <code><screenshot></code><br />
<br />
If some elements are empty or not specified, it will be treated as non-existing/not provided.<br />
<br />
Example:<br />
<source lang="xml"><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<screenshot>resources/screenshot-01.jpg</screenshot><br />
<screenshot>resources/screenshot-02.jpg</screenshot><br />
<screenshot>resources/screenshot-03.jpg</screenshot><br />
<screenshot>resources/screenshot-04.jpg</screenshot><br />
</assets><br />
</source><br />
<br />
With the above example definition, the files must be placed in the <code>resources</code> folder.<br />
<br />
== Skin specific elements ==<br />
=== Overview ===<br />
{| class="prettytable"<br />
| '''effectslowdown'''<br />
| 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.<br />
|- <br />
| '''debugging'''<br />
| When set to true, it'll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.<br />
|- <br />
| '''res'''<br />
| Support for arbitrary skin resolutions.<br />
|}<br />
<br />
=== How window xml files are found ===<br />
<br />
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.<br />
<br />
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).<br />
<br />
The order that Kodi looks for it's skin files are as follows:<br />
<br />
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)<br />
# If the current screenmode is 1080i and there's no 1080i folder, it then looks in the 720p folder.<br />
# Finally, it looks in the '''res''' folder.<br />
<br />
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.<br />
<br />
= Examples =<br />
<br />
== addon.xml for skins ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<addon<br />
id="skin.confluence"<br />
version="2.1.3"<br />
name="Confluence"<br />
provider-name="Jezz_X, Team Kodi"><br />
<requires><br />
<import addon="xbmc.gui" version="5.13.0"/><br />
</requires><br />
<extension<br />
point="xbmc.gui.skin"<br />
debugging="false"<br />
effectslowdown="0.75"><br />
<res width="1280" height="720" aspect="16:9" default="true" folder="720p" /><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Confluence skin by Jezz_X. (Kodi's default skin)</summary><br />
<description lang="en">Confluence is the default skin for Kodi 9.11 and above. It is a combination of concepts from many popular skins, and attempts to embrace and integrate their good ideas into a skin that should be easy for first time Kodi users to understand and use.</description><br />
<disclaimer lang="en">Confluence is the default skin for Kodi, removing it may cause issues</disclaimer><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
One thing to note is that <font color="red">all tag names are lower case.</font> XML tag names are case sensitive!<br />
<br />
== addon.xml for scripts ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon<br />
id="script.artwork.downloader"<br />
name="Artwork Downloader"<br />
version="12.0.12"<br />
provider-name="Martijn"><br />
<requires><br />
<import addon="xbmc.python" version="2.1.0"/><br />
<import addon="xbmc.json" version="6.0.0"/><br />
<import addon="xbmc.addon" version="12.0.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10" optional="true"/><br />
<import addon="script.common.plugin.cache" version="1.3.0"/><br />
</requires><br />
<extension point="xbmc.python.script" library="default.py"><br />
<provides>executable</provides><br />
</extension><br />
<extension point="xbmc.service" library="service.py" start="login"/><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary><br />
<description lang="en">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><br />
<disclaimer lang="en">For bugs, requests or general questions visit the Artwork Downloader thread on the Kodi forum.</disclaimer><br />
<language></language><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
=== Common errors ===<br />
<br />
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:<br />
<br />
# Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc<br />
# Too large description can sometimes cause issues<br />
# You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description><br />
# 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:<br />
* .kodi/addons/temp<br />
* .kodi/temp/temp<br />
* .kodi/temp/archive_cache<br />
<br />
= Schema Definition =<br />
<br />
The XML schema definition for <code>addon.xml</code> is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].<br />
<br />
{{Krypton updated}}<br />
<br />
[[Category:Add-on development]]<br />
[[Category:Skin development]]</div>Leopheardhttps://kodi.wiki/index.php?title=Addon.xml&diff=177027Addon.xml2019-08-02T17:29:08Z<p>Leopheard: Common errors</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br /><br />
<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.<br />
<br />
Every <code>addon.xml</code> file has the same basic structure, this example is for a video plugin:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You"><br />
<requires><br />
<import addon="xbmc.python" version="2.25.0"/><br />
</requires><br />
<extension point="xbmc.python.pluginsource" library="addon.py"><br />
<provides>video</provides><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en_GB">Your add-on's summary</summary><br />
<description lang="en_GB">Your add-on's description</description><br />
<disclaimer lang="en_GB"></disclaimer><br />
<language>en</language> <!-- the language of the videos the plugin provides, may be left blank --><br />
<platform>all</platform><br />
<license>GPL-2.0</license><br />
<forum>https://forum.kodi.tv/showthread.php?tid=xxxx</forum> <!-- may be left blank --><br />
<website>http://myplugin.com</website> <!-- the url of the website that contains the videos (or the official website of your plugin). --><br />
<email>you@youremail.com</email> <!-- may be left blank --><br />
<source>http://github.com/you/plugin.addon.id</source><br />
<news>v1.2.3 (01/02/201x)<br />
[new] some new feature<br />
[fix] some fix<br />
</news><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<banner></banner><br />
<clearlogo>resources/clearlogo.png</clearlogo><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
There are a few important things to note in the above sample:<br />
<br />
* The <code><addon></code> element must be present, and be the root node. It presents data about the add-on package as a whole.<br />
* 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.<br />
* Then there are one or more <code><extension></code> elements, each of which describes a part of Kodi that the add-on extends.<br />
* Finally, there is a specific <code><extension></code> element that extends <code>"xbmc.addon.metadata"</code>. This describes the add-on to the user.<br />
* Banners and clearlogos assets exclusive to Kodi v.18+<br />
= Elements =<br />
<br />
== <addon> ==<br />
<br />
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:<br />
<br />
<source lang="xml"><br />
<addon id="script.hello.world" name="Hello World" version="0.0.1" provider-name="Dev1, Dev2"><br />
</source><br />
<br />
=== id attribute ===<br />
<br />
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>.<br />
<br />
=== version attribute ===<br />
<br />
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>.<br />
<br />
==== How versioning works ====<br />
<br />
* <code>2.2.9</code> is newer than <code>2.2.1</code><br />
* <code>2.2.10</code> is newer than <code>2.2.1</code><br />
* <code>2.3.0</code> is newer than <code>2.2.9</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1</code> is newer than <code>2.2.1~beta</code><br />
* <code>2.2.1~beta</code> is newer than <code>2.2.1~alpha</code><br />
* <code>2.2.1~beta3</code> is newer than <code>2.2.1~beta2</code><br />
* <code>2.2.1~beta10</code> is newer than <code>2.2.1~beta1</code><br />
<br />
{{tip|Text should only be added for a beta version. In other cases version number should only contain numbers.}}<br />
<br />
=== name attribute ===<br />
<br />
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.<br />
<br />
=== provider-name attribute ===<br />
<br />
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>).<br />
<br />
== <requires> ==<br />
<br />
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.<br />
<br />
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.<br />
<br />
=== Examples ===<br />
<br />
Here is a sample <code><requires></code> block that imports two required modules:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="xbmc.python" version="2.14.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10"/><br />
</requires><br />
</source><br />
<br />
Here's another example, which will only install on OpenELEC:<br />
<br />
<source lang="xml"><br />
<requires><br />
<import addon="os.openelec.tv" version="2.0"/><br />
</requires><br />
</source><br />
<br />
== <import> ==<br />
<br />
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>.<br />
<br />
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.<br />
<br />
=== addon attribute ===<br />
<br />
The <code>addon</code> attribute specifies the id of the required add-on, e.g. <code>script.module.elementtree</code>.<br />
<br />
=== version attribute ===<br />
<br />
The <code>version</code> attribute specifies the minimum version of the required add-on to be installed.<br />
<br />
==== Dependency versions ====<br />
<br />
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.<br />
<br />
{| class="prettytable" border="1"<br />
|+ Current versions<br />
! Kodi version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon<br />
|-<br />
| Dharma 10.1 <font color="red">Deprecated</font>|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1<br />
|-<br />
| Eden 11.0 <font color="red">Deprecated</font> || 2.0 || 3.0 || 4.0 || 1.0 || 11.0<br />
|-<br />
| Frodo 12.x <font color="red">Deprecated</font>|| 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|-<br />
| 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)<br />
|}<br />
<br />
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".<br />
<br />
=== optional attribute ===<br />
<br />
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.<br />
<br />
== <extension> ==<br />
<br />
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.<br />
<br />
The various extension points that Kodi provides are given in the list below.<br />
{| class="prettytable"<br />
!Extension point<br />
!Add-on Category<br />
|-<br />
|<code>[[Skinning|xbmc.gui.skin]]</code><br />
|Skin<br />
|-<br />
|<code>xbmc.webinterface</code><br />
|Web interface<br />
|-<br />
|<code>[[Add-on repositories|xbmc.addon.repository]]</code><br />
|''None''<br />
|-<br />
|<code>[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]</code><br />
|Services<br />
|-<br />
|<code>xbmc.metadata.scraper.albums</code><br />
|Album information<br />
|-<br />
|<code>xbmc.metadata.scraper.artists</code><br />
|Artist information<br />
|-<br />
|<code>xbmc.metadata.scraper.movies</code><br />
|Movie information<br />
|-<br />
|<code>xbmc.metadata.scraper.musicvideos</code><br />
|Music video information<br />
|-<br />
|<code>xbmc.metadata.scraper.tvshows</code><br />
|TV information<br />
|-<br />
|<code>xbmc.metadata.scraper.library</code><br />
|''None''<br />
|-<br />
|<code>xbmc.ui.screensaver</code><br />
|Screensaver<br />
|-<br />
|<code>xbmc.player.musicviz</code><br />
|Visualization<br />
|-<br />
|<code>[[Plugin sources#What Kodi requires for your add-on|xbmc.python.pluginsource]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>[[Script sources#What Kodi requires for your add-on|xbmc.python.script]]</code><br />
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)<br />
|-<br />
|<code>xbmc.python.weather</code><br />
|Weather<br />
|-<br />
|<code>xbmc.subtitle.module</code><br />
|Subtitle service module<br />
|-<br />
|<code>[[Script lyrics#What Kodi requires for your add-on|xbmc.python.lyrics]]</code><br />
|Lyrics<br />
|-<br />
|<code>[[Script library#What Kodi requires for your add-on|xbmc.python.library]]</code><br />
|''None''<br />
|-<br />
|<code>xbmc.python.module</code><br />
|These don't show up in the addon browser and are purely as support for other scripts.<br />
|-<br />
|<code>xbmc.addon.video</code><br />
|Video Add-ons (video)<br />
|-<br />
|<code>xbmc.addon.audio</code><br />
|Music Add-ons (audio)<br />
|-<br />
|<code>xbmc.addon.image</code><br />
|Picture Add-ons (image)<br />
|-<br />
|<code>kodi.resource.images</code><br />
|Additional image files<br />
|-<br />
|<code>kodi.resource.language</code><br />
|Additional language files<br />
|}<br />
<br />
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.<br />
<br />
=== xbmc.python.pluginsource ===<br />
{{See also|Plugin sources}}<br />
<br />
The most common extension point that will be used by plugin addon developers is <code>xbmc.python.pluginsource</code>.<br />
<br />
==== library attribute ====<br />
<br />
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.<br />
<br />
==== <provides> element ====<br />
<br />
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):<br />
<br />
{| class="prettytable"<br />
!Provides<br />
!Appears in<br />
|-<br />
|<code>image</code><br />
|Pictures<br />
|-<br />
|<code>audio</code><br />
|Music<br />
|-<br />
|<code>video</code><br />
|Video<br />
|-<br />
|<code>executable</code><br />
|Programs<br />
|-<br />
|''(blank)''<br />
|Not visible<br />
|}<br />
<br />
==== Example ====<br />
<br />
<source lang="xml"><br />
<extension point="xbmc.python.pluginsource" library="gpodderxbmc.py"><br />
<provides>audio video</provides><br />
</extension><br />
</source><br />
<br />
=== xbmc.addon.metadata ===<br />
<br />
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.<br />
<br />
==== Required elements ====<br />
<br />
There are several elements that this should contain and all are compulsory (except the broken tag). Each of the elements below must always be present in English as a minimum.<br />
<br />
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)]]).<br />
<br />
===== <summary> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<summary lang="en_GB">Hello World script provides some basic examples on how to create your first script.</summary><br />
</source><br />
<br />
===== <description> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<description lang="en_GB">Hello World script provides some basic examples on how to create your first script<br />
and hopefully will increase the number of Kodi users to start creating their own addons.</description><br />
</source><br />
<br />
===== <disclaimer> =====<br />
<br />
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.<br />
<br />
<source lang="xml"><br />
<disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer><br />
</source><br />
<br />
===== <news> =====<br />
<br />
{{note|Used in Kodi v17 Krypton and later only. Older versions are forward compatible.}}<br />
<br />
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.)<br />
Please keep it short (it's limited to 1500 characters), you might want to only include the changes for the last version here.<br />
<br />
Here is an example: <br />
<br />
<source lang="xml"><br />
<news>v0.1.2 (2014-1-15)<br />
- Added notification for Ubuntu users checking through apt command</news><br />
</source><br />
<br />
===== <platform> =====<br />
<br />
The <code><platform></code> tag specifies which platforms (operating systems, hardware) 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:<br />
<br />
* <code>all</code><br />
* <code>linux</code><br />
* <code>osx</code><br />
* <code>osx64</code><br />
* <code>osx32</code><br />
* <code>ios</code><br />
* <code>windx</code><br />
* <code>android</code><br />
<br />
<source lang="xml"><br />
<platform>all</platform><br />
</source><br />
<br />
===== <language> =====<br />
<br />
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, leave it blank.<br />
<br />
<source lang="xml"><br />
<language>en de fr</language><br />
or<br />
<language></language><br />
</source><br />
<br />
===== <license> =====<br />
<br />
The <code><license></code> element indicates what license is used for this add-on.<br />
<br />
<source lang="xml"><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
</source><br />
<br />
===== <forum> =====<br />
<br />
The <code><forum></code> element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.<br />
<source lang="xml"><br />
<forum>http://www.myaddonwebsite.com/forum.php?thread=12345</forum><br />
</source><br />
<br />
===== <website> =====<br />
<br />
The <code><website></code> element provides the website URL for this specific add-on.<br />
<br />
<source lang="xml"><br />
<website>http://www.myaddonwebsite.com/</website><br />
</source><br />
<br />
===== <nowiki><source></nowiki> =====<br />
<br />
The <code><nowiki><source></nowiki></code> element provides the URL for the source code for this specific add-on.<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<source>http://github.com/someone/myaddon</source><br />
</syntaxhighlight><br />
<br />
===== <email> =====<br />
<br />
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.<br />
<source lang="xml"><br />
<email>foo@bar.com</email><br />
or<br />
<email>foo at bar dot com</email><br />
</source><br />
<br />
===== <broken> =====<br />
<br />
The <code><broken></code> tag will mark the add-on as broken in the Kodi repo and provide the reason why. It is recommended to also add some more information in the changelog.<br />
<br />
<source lang="xml"><br />
<broken>deprecated</broken><br />
</source><br />
<br />
===== <assets> =====<br />
<br />
{{note|Kodi v17 Krypton and later.}}<br />
<br />
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:<br />
<br />
* <code><icon></code> See [[Add-on_structure#icon.png]] - if an icon.png file exists it must be listed here<br />
* <code><fanart></code> See [[Add-on_structure#fanart.jpg]] - if a fanart.jpg file exists it must be listed here<br />
* <code><screenshot></code><br />
<br />
If some elements are empty or not specified, it will be treated as non-existing/not provided.<br />
<br />
Example:<br />
<source lang="xml"><br />
<assets><br />
<icon>resources/icon.png</icon><br />
<fanart>resources/fanart.jpg</fanart><br />
<screenshot>resources/screenshot-01.jpg</screenshot><br />
<screenshot>resources/screenshot-02.jpg</screenshot><br />
<screenshot>resources/screenshot-03.jpg</screenshot><br />
<screenshot>resources/screenshot-04.jpg</screenshot><br />
</assets><br />
</source><br />
<br />
With the above example definition, the files must be placed in the <code>resources</code> folder.<br />
<br />
== Skin specific elements ==<br />
=== Overview ===<br />
{| class="prettytable"<br />
| '''effectslowdown'''<br />
| 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.<br />
|- <br />
| '''debugging'''<br />
| When set to true, it'll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.<br />
|- <br />
| '''res'''<br />
| Support for arbitrary skin resolutions.<br />
|}<br />
<br />
=== How window xml files are found ===<br />
<br />
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.<br />
<br />
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).<br />
<br />
The order that Kodi looks for it's skin files are as follows:<br />
<br />
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)<br />
# If the current screenmode is 1080i and there's no 1080i folder, it then looks in the 720p folder.<br />
# Finally, it looks in the '''res''' folder.<br />
<br />
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.<br />
<br />
= Examples =<br />
<br />
== addon.xml for skins ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<addon<br />
id="skin.confluence"<br />
version="2.1.3"<br />
name="Confluence"<br />
provider-name="Jezz_X, Team Kodi"><br />
<requires><br />
<import addon="xbmc.gui" version="5.13.0"/><br />
</requires><br />
<extension<br />
point="xbmc.gui.skin"<br />
debugging="false"<br />
effectslowdown="0.75"><br />
<res width="1280" height="720" aspect="16:9" default="true" folder="720p" /><br />
</extension><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Confluence skin by Jezz_X. (Kodi's default skin)</summary><br />
<description lang="en">Confluence is the default skin for Kodi 9.11 and above. It is a combination of concepts from many popular skins, and attempts to embrace and integrate their good ideas into a skin that should be easy for first time Kodi users to understand and use.</description><br />
<disclaimer lang="en">Confluence is the default skin for Kodi, removing it may cause issues</disclaimer><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
One thing to note is that <font color="red">all tag names are lower case.</font> XML tag names are case sensitive!<br />
<br />
== addon.xml for scripts ==<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon<br />
id="script.artwork.downloader"<br />
name="Artwork Downloader"<br />
version="12.0.12"<br />
provider-name="Martijn"><br />
<requires><br />
<import addon="xbmc.python" version="2.1.0"/><br />
<import addon="xbmc.json" version="6.0.0"/><br />
<import addon="xbmc.addon" version="12.0.0"/><br />
<import addon="script.module.elementtree" version="1.2.7"/><br />
<import addon="script.module.simplejson" version="2.0.10" optional="true"/><br />
<import addon="script.common.plugin.cache" version="1.3.0"/><br />
</requires><br />
<extension point="xbmc.python.script" library="default.py"><br />
<provides>executable</provides><br />
</extension><br />
<extension point="xbmc.service" library="service.py" start="login"/><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Downloads Artwork for TV shows, Movies and Musicvideos in your library</summary><br />
<description lang="en">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><br />
<disclaimer lang="en">For bugs, requests or general questions visit the Artwork Downloader thread on the Kodi forum.</disclaimer><br />
<language></language><br />
<platform>all</platform><br />
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license><br />
<forum></forum><br />
<website></website><br />
<email></email><br />
<source></source><br />
<news></news><br />
<assets><br />
<icon></icon><br />
<fanart></fanart><br />
<screenshot></screenshot><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
=== Common errors ===<br />
<br />
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:<br />
<br />
1. Invalid characters - does any of your description text, addon name, etc. have any of the following? !, ?, -, etc<br />
2. Too large description can sometimes cause issues<br />
3. You may have an opening tag but not a closing tag further in the file e.g. <description> but not later on </description><br />
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:<br />
- .kodi/addons/temp<br />
- .kodi/temp/temp<br />
- .kodi/temp/archive_cache<br />
<br />
= Schema Definition =<br />
<br />
The XML schema definition for <code>addon.xml</code> is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].<br />
<br />
{{Krypton updated}}<br />
<br />
[[Category:Add-on development]]<br />
[[Category:Skin development]]</div>Leopheard