<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pline</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pline"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Pline"/>
	<updated>2026-06-17T00:34:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_development&amp;diff=73044</id>
		<title>Add-on development</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_development&amp;diff=73044"/>
		<updated>2014-04-19T19:46:46Z</updated>

		<summary type="html">&lt;p&gt;Pline: Remove redirect for A/V add-on tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
[[File:Wiki logo.png|150px|link=|left]]&lt;br /&gt;
&amp;lt;section begin=&amp;quot;intro&amp;quot; /&amp;gt;This area contains information, tutorials, and links for creating add-ons for XBMC.&amp;lt;section end=&amp;quot;intro&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[General topics|{{color|black|General}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Applications-development.svg|link=Add-on structure|title=Add-on Structure}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Administration.png|link=Development Tools}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Tutorials|{{color|black|Tutorials}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=IYY logo.png|link=Audio/video add-on tutorial|title=Audio/Video Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Translation - Noun project 987.svg|link=HOW-TO:HelloWorld_addon|title=GUI Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Programming-128.png‎|link=Program Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Web-icon.png|link=Writing_media_info_scrapers_guide|title=Scraper Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Video.svg|link=3rd Party Tutorials}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=HP-TV-icon.png|link=ScreenSaver Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Advanced}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Book icon 1.png|link=Python Libraries}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Network2.png|link=Add-on Repositories}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Gnome-system-run.svg|link=Add-on settings|title=Add-on Settings}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Bug.png‎|link=HOW-TO:Debug_Python_Scripts_with_Eclipse|title=Debugging Python}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Python.svg‎|link=Python Development}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Blue-Dossier-128.png|link=http://mirrors.xbmc.org/docs/python-docs PyDocs}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Publishing}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Thumbs up font awesome.svg‎|link=Add-on Rules}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Tape-Measure-128.png‎|link=Add-on Standards}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Repositories|{{color|black|Repositories}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=XBMC New Logo.svg|link=Official_add-on_repository|title=Official Add-on Repository}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Zappy.png|link=Add-on Website}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Box_icon.png‎|link=3rd_party_add-on_repositories|title=Third Party Add-on Repository}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_development&amp;diff=73043</id>
		<title>Add-on development</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_development&amp;diff=73043"/>
		<updated>2014-04-19T19:46:11Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
[[File:Wiki logo.png|150px|link=|left]]&lt;br /&gt;
&amp;lt;section begin=&amp;quot;intro&amp;quot; /&amp;gt;This area contains information, tutorials, and links for creating add-ons for XBMC.&amp;lt;section end=&amp;quot;intro&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[General topics|{{color|black|General}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Applications-development.svg|link=Add-on structure|title=Add-on Structure}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Administration.png|link=Development Tools}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Tutorials|{{color|black|Tutorials}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=IYY logo.png|link=Audio/Video add-on tutorial|title=Audio/Video Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Translation - Noun project 987.svg|link=HOW-TO:HelloWorld_addon|title=GUI Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Programming-128.png‎|link=Program Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Web-icon.png|link=Writing_media_info_scrapers_guide|title=Scraper Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Video.svg|link=3rd Party Tutorials}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=HP-TV-icon.png|link=ScreenSaver Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Advanced}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Book icon 1.png|link=Python Libraries}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Network2.png|link=Add-on Repositories}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Gnome-system-run.svg|link=Add-on settings|title=Add-on Settings}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Bug.png‎|link=HOW-TO:Debug_Python_Scripts_with_Eclipse|title=Debugging Python}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Python.svg‎|link=Python Development}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Blue-Dossier-128.png|link=http://mirrors.xbmc.org/docs/python-docs PyDocs}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Publishing}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Thumbs up font awesome.svg‎|link=Add-on Rules}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Tape-Measure-128.png‎|link=Add-on Standards}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Repositories|{{color|black|Repositories}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=XBMC New Logo.svg|link=Official_add-on_repository|title=Official Add-on Repository}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Zappy.png|link=Add-on Website}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Box_icon.png‎|link=3rd_party_add-on_repositories|title=Third Party Add-on Repository}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=68499</id>
		<title>Audio-video add-on tutorial</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=68499"/>
		<updated>2014-01-28T07:54:00Z</updated>

		<summary type="html">&lt;p&gt;Pline: s/encode/urlencode/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page will outline the basics of creating your first Python add-on for XBMC. It assumes you&#039;re at least familiar with the basics of Python (or at least, programming in general). If not, we recommend visiting the [http://docs.python.org/2/tutorial/ Python tutorial] first, and then returning here.&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_handle = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_handle, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_handle = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_handle, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.urlencode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
Your add-on may require some configurable options for the user (e.g. login credentials for a service). These can be stored as settings. To use settings with your add-on, you&#039;ll need to make a file defining the settings in &amp;lt;code&amp;gt;resources/settings.xml&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;my_setting&amp;quot; type=&amp;quot;bool&amp;quot; default=&amp;quot;true&amp;quot; label=&amp;quot;My Setting&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the user to open the settings for your add-on and modify this setting as needed. Then, in your add-on, you can retrieve or set this setting with the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.my-addon&#039;)&lt;br /&gt;
my_setting = my_addon.getSetting(&#039;my_setting&#039;) # returns the string &#039;true&#039; or &#039;false&#039;&lt;br /&gt;
my_addon.setSetting(&#039;my_setting&#039;, &#039;false&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
In addition to the default action for a list item (e.g. playing the video), your add-on can provide additional actions for an item in the context menu. Note that this only applies to list items in &#039;&#039;your&#039;&#039; add-on. Currently, you&#039;re not able to modify the context menu for movies in the user&#039;s library. To add a context menu item, you need to give it a label and a [[List of built-in functions|built-in function]] as a string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;),&lt;br /&gt;
                         (&#039;Go up&#039;, &#039;Action(ParentDir)&#039;) ])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also elect to show &#039;&#039;only&#039;&#039; your context menu items:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;) ], replaceItems=True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=67701</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=67701"/>
		<updated>2014-01-09T23:17:45Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;requires&amp;gt;&lt;br /&gt;
  &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;requires&amp;gt;&lt;br /&gt;
  &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.14.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.gui.webinterface&amp;lt;/code&amp;gt;&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=67700</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=67700"/>
		<updated>2014-01-09T23:17:20Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.14.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.gui.webinterface&amp;lt;/code&amp;gt;&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=67699</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=67699"/>
		<updated>2014-01-09T23:16:47Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.14.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.gui.webinterface&amp;lt;/code&amp;gt;&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=67698</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=67698"/>
		<updated>2014-01-09T23:14:23Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Directory structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addon-type&amp;gt;[.&amp;lt;media-type&amp;gt;].&amp;lt;your-plugin-name&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon-type&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;media-type&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;media-type&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   data/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 v0.1.3&lt;br /&gt;
 - Update with 13.0 Gotham_alpha2&lt;br /&gt;
 &lt;br /&gt;
 v0.1.2&lt;br /&gt;
 - Add notification for Ubuntu users checking through apt command&lt;br /&gt;
 &lt;br /&gt;
 v0.1.1&lt;br /&gt;
 - Initial version&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}&lt;br /&gt;
&lt;br /&gt;
This file should contain the text of whatever software license you&#039;ve chosen to release your add-on under (e.g. GPLv2).&lt;br /&gt;
&lt;br /&gt;
=== resources/ ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subdirectory is the preferred place to put any files that the add-on uses that don&#039;t need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
==== resources/settings.xml ====&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== resources/language/ ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
==== resources/lib/ ====&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
==== resources/data/ ====&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
==== resources/media/ ====&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive_talk:HOW-TO:Write_plugins_for_XBMC&amp;diff=67697</id>
		<title>Archive talk:HOW-TO:Write plugins for XBMC</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive_talk:HOW-TO:Write_plugins_for_XBMC&amp;diff=67697"/>
		<updated>2014-01-09T23:08:16Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Bad Design==&lt;br /&gt;
This page is very badly designed, it mixes many layers of knowledge:&lt;br /&gt;
&lt;br /&gt;
- python&lt;br /&gt;
&lt;br /&gt;
- python editor&lt;br /&gt;
&lt;br /&gt;
- traffic sniffing&lt;br /&gt;
&lt;br /&gt;
- plugin writing&lt;br /&gt;
&lt;br /&gt;
Instead it should only delve into details about &amp;quot;how to write a plugin&amp;quot;, taking for granted knowledge about the rest&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;object oriented&amp;quot; approach would be better, explaining the meaning an expected behavior of the methods that must be  implemented in the plugin to make xbmc accept it&lt;br /&gt;
&lt;br /&gt;
== I&#039;ll be cleaning this up ==&lt;br /&gt;
I&#039;m doing some house-cleaning on this, this page is hideous. --[[User:Webbeh|Webbeh]] 23:28, 1 May 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Delete this page? ==&lt;br /&gt;
&lt;br /&gt;
I added a [[Audio/video add-on tutorial|tutorial]] for audio/video add-ons that should cover most of the XBMC-specific parts of this. Maybe we should just delete this page and redirect it to the new tutorial? It might be wise to look over this page to make sure the new tutorial isn&#039;t missing anything useful. [[User:Pline|Pline]] ([[User talk:Pline|talk]]) 18:08, 9 January 2014 (EST)&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_development&amp;diff=66955</id>
		<title>Add-on development</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_development&amp;diff=66955"/>
		<updated>2013-12-19T18:19:16Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
[[File:Wiki logo.png|150px|link=|left]]&lt;br /&gt;
&lt;br /&gt;
Here you will find all the information you need to start writing Add-ons for XBMC.&lt;br /&gt;
&lt;br /&gt;
We provide tutorials and guides as well as explanations of the structure of Add-ons.&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[General topics|{{color|black|General}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Applications-development.svg|link=Add-on structure|title=Add-on Structure}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Administration.png|link=Development Tools}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Tutorials|{{color|black|Tutorials}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=IYY logo.png|link=Audio/Video plugin tutorial|title=Audio/Video Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Translation - Noun project 987.svg|link=HOW-TO:HelloWorld_addon|title=GUI Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Programming-128.png‎|link=Program Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Web-icon.png|link=Writing_media_info_scrapers_guide|title=Scraper Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Video.svg|link=PVR Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=HP-TV-icon.png|link=ScreenSaver Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Advanced}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Book icon 1.png|link=Python Libraries}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Network2.png|link=Add-on Repositories}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Gnome-system-run.svg|link=Add-on settings|title=Add-on Settings}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Bug.png‎|link=HOW-TO:Debug_Python_Scripts_with_Eclipse|title=Debugging Python}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Python.svg‎|link=Python Development}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Blue-Dossier-128.png|link=http://mirrors.xbmc.org/docs/python-docs PyDocs}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Publishing}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Thumbs up font awesome.svg‎|link=Add-on Rules}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Tape-Measure-128.png‎|link=Add-on Standards}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Repositories|{{color|black|Repositories}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=XBMC New Logo.svg|link=Official_add-on_repository|title=Official Add-on Repository}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Zappy.png|link=Add-on Website}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Box_icon.png‎|link=3rd_party_add-on_repositories|title=Third Party Add-on Repository}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=66953</id>
		<title>Audio-video add-on tutorial</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=66953"/>
		<updated>2013-12-19T18:16:35Z</updated>

		<summary type="html">&lt;p&gt;Pline: Pline moved page Audio/Video tutorial to Audio/Video plugin tutorial: Clarify name of page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page will outline the basics of creating your first Python add-on for XBMC. It assumes you&#039;re at least familiar with the basics of Python (or at least, programming in general). If not, we recommend visiting the [http://docs.python.org/2/tutorial/ Python tutorial] first, and then returning here.&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_handle = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_handle, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_handle = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_handle, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
Your add-on may require some configurable options for the user (e.g. login credentials for a service). These can be stored as settings. To use settings with your add-on, you&#039;ll need to make a file defining the settings in &amp;lt;code&amp;gt;resources/settings.xml&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;my_setting&amp;quot; type=&amp;quot;bool&amp;quot; default=&amp;quot;true&amp;quot; label=&amp;quot;My Setting&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the user to open the settings for your add-on and modify this setting as needed. Then, in your add-on, you can retrieve or set this setting with the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.my-addon&#039;)&lt;br /&gt;
my_setting = my_addon.getSetting(&#039;my_setting&#039;) # returns the string &#039;true&#039; or &#039;false&#039;&lt;br /&gt;
my_addon.setSetting(&#039;my_setting&#039;, &#039;false&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
In addition to the default action for a list item (e.g. playing the video), your add-on can provide additional actions for an item in the context menu. Note that this only applies to list items in &#039;&#039;your&#039;&#039; add-on. Currently, you&#039;re not able to modify the context menu for movies in the user&#039;s library. To add a context menu item, you need to give it a label and a [[List of built-in functions|built-in function]] as a string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;),&lt;br /&gt;
                         (&#039;Go up&#039;, &#039;Action(ParentDir)&#039;) ])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also elect to show &#039;&#039;only&#039;&#039; your context menu items:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;) ], replaceItems=True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=66942</id>
		<title>Audio-video add-on tutorial</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=66942"/>
		<updated>2013-12-18T21:54:17Z</updated>

		<summary type="html">&lt;p&gt;Pline: s/addon_id/addon_handle/g&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page will outline the basics of creating your first Python add-on for XBMC. It assumes you&#039;re at least familiar with the basics of Python (or at least, programming in general). If not, we recommend visiting the [http://docs.python.org/2/tutorial/ Python tutorial] first, and then returning here.&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_handle = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_handle, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_handle = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_handle, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_handle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
Your add-on may require some configurable options for the user (e.g. login credentials for a service). These can be stored as settings. To use settings with your add-on, you&#039;ll need to make a file defining the settings in &amp;lt;code&amp;gt;resources/settings.xml&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;my_setting&amp;quot; type=&amp;quot;bool&amp;quot; default=&amp;quot;true&amp;quot; label=&amp;quot;My Setting&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the user to open the settings for your add-on and modify this setting as needed. Then, in your add-on, you can retrieve or set this setting with the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.my-addon&#039;)&lt;br /&gt;
my_setting = my_addon.getSetting(&#039;my_setting&#039;) # returns the string &#039;true&#039; or &#039;false&#039;&lt;br /&gt;
my_addon.setSetting(&#039;my_setting&#039;, &#039;false&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
In addition to the default action for a list item (e.g. playing the video), your add-on can provide additional actions for an item in the context menu. Note that this only applies to list items in &#039;&#039;your&#039;&#039; add-on. Currently, you&#039;re not able to modify the context menu for movies in the user&#039;s library. To add a context menu item, you need to give it a label and a [[List of built-in functions|built-in function]] as a string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;),&lt;br /&gt;
                         (&#039;Go up&#039;, &#039;Action(ParentDir)&#039;) ])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also elect to show &#039;&#039;only&#039;&#039; your context menu items:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;) ], replaceItems=True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66924</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66924"/>
		<updated>2013-12-18T00:33:48Z</updated>

		<summary type="html">&lt;p&gt;Pline: Blanking this, since I moved it to Audio/Video tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=66923</id>
		<title>Audio-video add-on tutorial</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Audio-video_add-on_tutorial&amp;diff=66923"/>
		<updated>2013-12-18T00:33:05Z</updated>

		<summary type="html">&lt;p&gt;Pline: Created page with &amp;quot;{{mininav|Development|Add-on development}}  This page will outline the basics of creating your first Python add-on for XBMC. It assumes you&amp;#039;re at least familiar with t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page will outline the basics of creating your first Python add-on for XBMC. It assumes you&#039;re at least familiar with the basics of Python (or at least, programming in general). If not, we recommend visiting the [http://docs.python.org/2/tutorial/ Python tutorial] first, and then returning here.&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
Your add-on may require some configurable options for the user (e.g. login credentials for a service). These can be stored as settings. To use settings with your add-on, you&#039;ll need to make a file defining the settings in &amp;lt;code&amp;gt;resources/settings.xml&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;my_setting&amp;quot; type=&amp;quot;bool&amp;quot; default=&amp;quot;true&amp;quot; label=&amp;quot;My Setting&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the user to open the settings for your add-on and modify this setting as needed. Then, in your add-on, you can retrieve or set this setting with the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.my-addon&#039;)&lt;br /&gt;
my_setting = my_addon.getSetting(&#039;my_setting&#039;) # returns the string &#039;true&#039; or &#039;false&#039;&lt;br /&gt;
my_addon.setSetting(&#039;my_setting&#039;, &#039;false&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
In addition to the default action for a list item (e.g. playing the video), your add-on can provide additional actions for an item in the context menu. Note that this only applies to list items in &#039;&#039;your&#039;&#039; add-on. Currently, you&#039;re not able to modify the context menu for movies in the user&#039;s library. To add a context menu item, you need to give it a label and a [[List of built-in functions|built-in function]] as a string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;),&lt;br /&gt;
                         (&#039;Go up&#039;, &#039;Action(ParentDir)&#039;) ])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also elect to show &#039;&#039;only&#039;&#039; your context menu items:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;) ], replaceItems=True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_development&amp;diff=66922</id>
		<title>Add-on development</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_development&amp;diff=66922"/>
		<updated>2013-12-18T00:29:47Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
[[File:Wiki logo.png|150px|link=|left]]&lt;br /&gt;
&lt;br /&gt;
Here you will find all the information you need to start writing Add-ons for XBMC.&lt;br /&gt;
&lt;br /&gt;
We provide tutorials and guides as well as explanations of the structure of Add-ons.&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[General topics|{{color|black|General}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Applications-development.svg|link=Add-on structure|title=Add-on Structure}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Administration.png|link=Development Tools}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Tutorials|{{color|black|Tutorials}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=IYY logo.png|link=Audio/Video tutorial|title=Audio/Video Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Translation - Noun project 987.svg|link=HOW-TO:HelloWorld_addon|title=GUI Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Programming-128.png‎|link=Program Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Web-icon.png|link=Writing_media_info_scrapers_guide|title=Scraper Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Video.svg|link=PVR Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=HP-TV-icon.png|link=ScreenSaver Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Advanced}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Book icon 1.png|link=Python Libraries}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Network2.png|link=Add-on Repositories}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Gnome-system-run.svg|link=Add-on settings|title=Add-on Settings}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Bug.png‎|link=HOW-TO:Debug_Python_Scripts_with_Eclipse|title=Debugging Python}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Python.svg‎|link=Python Development}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Blue-Dossier-128.png|link=http://mirrors.xbmc.org/docs/python-docs PyDocs}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Publishing}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Thumbs up font awesome.svg‎|link=Add-on Rules}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Tape-Measure-128.png‎|link=Add-on Standards}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Repositories|{{color|black|Repositories}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=XBMC New Logo.svg|link=Official_add-on_repository|title=Official Add-on Repository}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Zappy.png|link=Add-on Website}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Box_icon.png‎|link=3rd_party_add-on_repositories|title=Third Party Add-on Repository}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66921</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66921"/>
		<updated>2013-12-18T00:21:57Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Adding context menus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
Your add-on may require some configurable options for the user (e.g. login credentials for a service). These can be stored as settings. To use settings with your add-on, you&#039;ll need to make a file defining the settings in &amp;lt;code&amp;gt;resources/settings.xml&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;my_setting&amp;quot; type=&amp;quot;bool&amp;quot; default=&amp;quot;true&amp;quot; label=&amp;quot;My Setting&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the user to open the settings for your add-on and modify this setting as needed. Then, in your add-on, you can retrieve or set this setting with the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.my-addon&#039;)&lt;br /&gt;
my_setting = my_addon.getSetting(&#039;my_setting&#039;) # returns the string &#039;true&#039; or &#039;false&#039;&lt;br /&gt;
my_addon.setSetting(&#039;my_setting&#039;, &#039;false&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
In addition to the default action for a list item (e.g. playing the video), your add-on can provide additional actions for an item in the context menu. Note that this only applies to list items in &#039;&#039;your&#039;&#039; add-on. Currently, you&#039;re not able to modify the context menu for movies in the user&#039;s library. To add a context menu item, you need to give it a label and a [[List of built-in functions|built-in function]] as a string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;),&lt;br /&gt;
                         (&#039;Go up&#039;, &#039;Action(ParentDir)&#039;) ])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also elect to show &#039;&#039;only&#039;&#039; your context menu items:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addContextMenuItems([ (&#039;Refresh&#039;, &#039;Container.Refresh&#039;) ], replaceItems=True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66920</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66920"/>
		<updated>2013-12-18T00:08:20Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Working with user settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
Your add-on may require some configurable options for the user (e.g. login credentials for a service). These can be stored as settings. To use settings with your add-on, you&#039;ll need to make a file defining the settings in &amp;lt;code&amp;gt;resources/settings.xml&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;my_setting&amp;quot; type=&amp;quot;bool&amp;quot; default=&amp;quot;true&amp;quot; label=&amp;quot;My Setting&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the user to open the settings for your add-on and modify this setting as needed. Then, in your add-on, you can retrieve or set this setting with the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.my-addon&#039;)&lt;br /&gt;
my_setting = my_addon.getSetting(&#039;my_setting&#039;) # returns the string &#039;true&#039; or &#039;false&#039;&lt;br /&gt;
my_addon.setSetting(&#039;my_setting&#039;, &#039;false&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66818</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66818"/>
		<updated>2013-12-14T21:47:51Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Working with user settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_development&amp;diff=66817</id>
		<title>Add-on development</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_development&amp;diff=66817"/>
		<updated>2013-12-14T21:35:03Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
[[File:Wiki logo.png|150px|link=|left]]&lt;br /&gt;
&lt;br /&gt;
Here you will find all the information you need to start writing Add-ons for XBMC.&lt;br /&gt;
&lt;br /&gt;
We provide tutorials and guides as well as explanations of the structure of Add-ons.&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[General topics|{{color|black|General}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Applications-development.svg|link=Add-on Structure}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Administration.png|link=Development Tools}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Tutorials|{{color|black|Tutorials}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Translation - Noun project 987.svg|link=HOW-TO:HelloWorld_addon|title=Hello World Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=IYY logo.png|link=Audio Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Video.svg|link=Video Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Programming-128.png‎|link=Program Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Web-icon.png|link=Writing_media_info_scrapers_guide|title=Scraper Tutorial}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=HP-TV-icon.png|link=ScreenSaver Tutorial}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Advanced}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Book icon 1.png|link=Python Libraries}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Network2.png|link=Add-on Repositories}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Gnome-system-run.svg|link=Add-on settings}}&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Bug.png‎|link=HOW-TO:Debug_Python_Scripts_with_Eclipse|title=Debugging Pyhton}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Python.svg‎|link=Python Development}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Blue-Dossier-128.png|link=http://mirrors.xbmc.org/docs/python-docs PyDocs}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Advanced|{{color|black|Publishing}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Thumbs up font awesome.svg‎|link=Add-on Rules}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Tape-Measure-128.png‎|link=Add-on Standards}}&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{{huge|&#039;&#039;&#039;[[Repositories|{{color|black|Repositories}}]]&#039;&#039;&#039;}}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=XBMC New Logo.svg|link=Official_add-on_repository|title=Official Add-on Repository}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Zappy.png|link=Add-on Website}}&lt;br /&gt;
| width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | {{Main page icon|image=Box_icon.png‎|link=3rd_party_add-on_repositories|title=Third Party Add-on Repository}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development|*]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66816</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66816"/>
		<updated>2013-12-14T21:32:51Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66815</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66815"/>
		<updated>2013-12-14T21:31:37Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Stream info */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
In addition to metadata about the file&#039;s contents, you can add information about the audio/video streams themselves. For a video, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.addStreamInfo(&#039;video&#039;, { &#039;codec&#039;: &#039;h264&#039;, &#039;aspect&#039;: 1.78, &#039;width&#039;: 1280,&lt;br /&gt;
                            &#039;height&#039;: 720, &#039;duration&#039;: 60 })&lt;br /&gt;
li.addStreamInfo(&#039;audio&#039;, { &#039;codec&#039;: &#039;dts&#039;, &#039;language&#039;: &#039;en&#039;, &#039;channels&#039;: 2 })&lt;br /&gt;
li.addStreamInfo(&#039;subtitle&#039;, { &#039;language&#039;: &#039;en&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complete documentation about this function, see &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-addStreamInfo ListItem.addStreamInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66727</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66727"/>
		<updated>2013-12-13T03:28:25Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Showing additional metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
XBMC also lets you add useful information about each list item, like the cast, episode number, play count, and duration. The specific fields available depend on whether your list item is video, audio, or a picture. In all cases though, the format is roughly the same. For example, to add info labels to a movie, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setInfo(&#039;video&#039;, { &#039;genre&#039;: &#039;Horror&#039;,&lt;br /&gt;
                      &#039;year&#039;: 1979,&lt;br /&gt;
                      &#039;title&#039;: &#039;Alien&#039; })&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a full list of the available info labels, consult the documentation for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem-setInfo ListItem.setInfo]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66726</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66726"/>
		<updated>2013-12-13T03:17:47Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Icons and thumbnails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fanart ==&lt;br /&gt;
&lt;br /&gt;
Fanart (full-screen background images) are another common thing for add-ons to show. This works a bit differently from icons and thumbnails, but it&#039;s still a simple process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, &#039;fanart.jpg&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;d prefer to show the default fanart from your add-on, you can get the path to that image from the &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcaddon.html#Addon xbmcaddon.Addon]&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
my_addon = xbmcaddon.Addon(&#039;plugin.video.myaddon&#039;)&lt;br /&gt;
# ...&lt;br /&gt;
li.setProperty(&#039;fanart_image&#039;, my_addon.getAddonInfo(&#039;fanart&#039;))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66725</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66725"/>
		<updated>2013-12-13T03:11:30Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Icons and thumbnails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
Our previous examples already showed how to set an icon, but you can also set a larger thumbnail for each list item. Both of these can be set in the &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li = xbmcgui.ListItem(label=&#039;My video&#039;, iconImage=&#039;icon.png&#039;, thumbnailImage=&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set these &#039;&#039;after&#039;&#039; creating the list item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
li.setIconImage(&#039;icon.png&#039;)&lt;br /&gt;
li.setThumbnailImage(&#039;thumbnail.png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66724</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66724"/>
		<updated>2013-12-13T03:08:16Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Showing additional metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Icons and thumbnails ==&lt;br /&gt;
&lt;br /&gt;
== Info labels ==&lt;br /&gt;
&lt;br /&gt;
== Stream info ==&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66712</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66712"/>
		<updated>2013-12-12T21:57:55Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Multiple content types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
{{See also|Addon.xml#&amp;lt;provides&amp;gt; element}}&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: examples&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66711</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66711"/>
		<updated>2013-12-12T21:56:35Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Retrieving arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
===  Multiple content types ===&lt;br /&gt;
&lt;br /&gt;
If your add-on provides multiple content types, e.g. &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, when the user invokes your add-on from the add-on list, XBMC will add a &amp;lt;code&amp;gt;content_type&amp;lt;/code&amp;gt; parameter to your add-on&#039;s query string. For example: &amp;lt;code&amp;gt;&#039;?content_type=audio&#039;&amp;lt;/code&amp;gt;. This will allow you to modify the output depending on what context your add-on was invoked in.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: examples&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66710</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66710"/>
		<updated>2013-12-12T21:13:05Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;br /&gt;
&lt;br /&gt;
= Showing additional metadata =&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already seen how to show some basic metadata, like the icon image and the type of the item (&amp;lt;code&amp;gt;&#039;video&#039;&amp;lt;/code&amp;gt; in our case). However, there are many more pieces of metadata that XBMC understands, and adding them can make life easier on your users. We&#039;ll take a look at some of the more important ones. You can also find a full list in the [http://mirrors.xbmc.org/docs/python-docs Python documentation] for &amp;lt;code&amp;gt;[http://mirrors.xbmc.org/docs/python-docs/12.2-frodo/xbmcgui.html#ListItem xbmcgui.ListItem]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: examples&lt;br /&gt;
&lt;br /&gt;
= Adding context menus =&lt;br /&gt;
&lt;br /&gt;
= Working with user settings =&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66709</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66709"/>
		<updated>2013-12-12T20:37:53Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Hello, World! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s process handle from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66708</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66708"/>
		<updated>2013-12-12T20:14:01Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* resources/settings.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addon-type&amp;gt;[.&amp;lt;media-type&amp;gt;].&amp;lt;your-plugin-name&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon-type&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;media-type&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;media-type&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   data/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}&lt;br /&gt;
&lt;br /&gt;
This file should contain the text of whatever software license you&#039;ve chosen to release your add-on under (e.g. GPLv2).&lt;br /&gt;
&lt;br /&gt;
=== resources/ ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subdirectory is the preferred place to put any files that the add-on uses that don&#039;t need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
==== resources/settings.xml ====&lt;br /&gt;
{{See also|Add-on settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== resources/language/ ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
==== resources/lib/ ====&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
==== resources/data/ ====&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
==== resources/media/ ====&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66707</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66707"/>
		<updated>2013-12-12T20:13:16Z</updated>

		<summary type="html">&lt;p&gt;Pline: Merge introduction and  overview since they&amp;#039;re both pretty short.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.12.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.gui.webinterface&amp;lt;/code&amp;gt;&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66664</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66664"/>
		<updated>2013-12-11T22:02:54Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Passing arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s id from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66663</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66663"/>
		<updated>2013-12-11T22:02:23Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Passing arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s id from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&#039;&amp;lt;/code&amp;gt;. With this information, we can tailor the output of our add-on to the supplied arguments.&lt;br /&gt;
&lt;br /&gt;
We also need to be able to create links back to our add-on in order to display related pages (e.g. subfolders). We can do this by creating an &amp;lt;code&amp;gt;xbmc.ListItem&amp;lt;/code&amp;gt;, passing &amp;lt;code&amp;gt;isFolder=True&amp;lt;/code&amp;gt;, and setting the URL of the item to point back to our add-on. We create the URL in the helper function &amp;lt;code&amp;gt;build_url()&amp;lt;/code&amp;gt;, which gives us a URL that looks something like:&lt;br /&gt;
&lt;br /&gt;
 plugin://plugin.video.myaddon/?mode=folder&amp;amp;foldername=Folder+One&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66662</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66662"/>
		<updated>2013-12-11T21:58:18Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Passing arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s id from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, many parts of our code are very similar to the first example. There are a few important additions, however. First, we want to respond to the arguments supplied to our script, so we parse the query string with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
urlparse.parse_qs(sys.argv[2][1:])&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We skip the first character, since it&#039;s always &amp;lt;code&amp;gt;&#039;?&#039;&amp;lt;/code&amp;gt;. This will give us a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;s; for example, &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;foo=baz&amp;amp;quux=spam&#039;&amp;lt;/code&amp;gt; would be converted to &amp;lt;code&amp;gt;{&#039;foo&#039;: [&#039;bar&#039;, &#039;baz&#039;], &#039;quux&#039;: [&#039;spam&#039;]}&#039;&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66661</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66661"/>
		<updated>2013-12-11T21:47:35Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Before we get started =&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
= Hello, World! =&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. First, we get the add-on&#039;s id from &amp;lt;code&amp;gt;sys.argv[1]&amp;lt;/code&amp;gt;. We need this to tell XBMC who we are. Next, we tell XBMC that we&#039;re going to show a list of &amp;lt;code&amp;gt;&#039;movies&#039;&amp;lt;/code&amp;gt;. There are other options, like &amp;lt;code&amp;gt;&#039;audio&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;episodes&#039;&amp;lt;/code&amp;gt;; these just change some details of how XBMC presents your add-on.&lt;br /&gt;
&lt;br /&gt;
The most important part is that we create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
= Navigating between pages =&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Most add-ons are designed to imitate a folder hierarchy where opening folder items shows a different list of items, and going &amp;quot;up&amp;quot; returns you to the parent folder.&lt;br /&gt;
&lt;br /&gt;
== Retrieving arguments ==&lt;br /&gt;
&lt;br /&gt;
As we saw in the first example, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Passing arguments ==&lt;br /&gt;
&lt;br /&gt;
Now that we know how to retrieve the arguments passed to our add-on, we&#039;ll have to actually pass some along to it. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on; then the next invocation of the add-on will parse those arguments and do something with them. Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlpase.parse_qs(sys.argv[2])&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66660</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66660"/>
		<updated>2013-12-11T21:38:28Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Navigating between pages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Python add-ons =&lt;br /&gt;
&lt;br /&gt;
== Before we get started ==&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
== Hello, World! ==&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. Most important is that we first create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
== The entry point ==&lt;br /&gt;
&lt;br /&gt;
As we saw above, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Navigating between pages ==&lt;br /&gt;
&lt;br /&gt;
While the first example might be enough for extremely simple add-ons, most add-ons will want to have the ability to navigate between different pages. Generally speaking, this involves creating a folder &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; with a URL back to your add-on and then parsing the arguments passed to it (stored in &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, as noted above). Let&#039;s look at another brief example that adds some folders to let the user navigate between different pages of the add-on:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlpase.parse_qs(sys.argv[2])&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=User:Pline&amp;diff=66659</id>
		<title>User:Pline</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=User:Pline&amp;diff=66659"/>
		<updated>2013-12-11T21:04:59Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* The structure of an add-on */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a staging area for some rewrites to the Python add-on documentation. Ok, let&#039;s go!&lt;br /&gt;
&lt;br /&gt;
= Python add-ons =&lt;br /&gt;
&lt;br /&gt;
== Before we get started ==&lt;br /&gt;
{{See also|Add-on structure}}&lt;br /&gt;
&lt;br /&gt;
The first step to making an add-on is to put the basic structure in place. Make sure your directory is properly named, e.g. &amp;lt;code&amp;gt;plugin.video.my-addon&amp;lt;/code&amp;gt;, and that you have a properly-constructed &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; file. Once these are done, you can get started writing the actual code for your add-on!&lt;br /&gt;
&lt;br /&gt;
== Hello, World! ==&lt;br /&gt;
&lt;br /&gt;
The simplest form of Python add-on is one that gets run, adds some list items, and exits to let XBMC take over the navigation; people who have written server-side code for the web should be familiar with how this works. (More complex add-ons can process user input in real-time, but we&#039;ll discuss those later.) Let&#039;s start by looking at an extremely basic example script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
&lt;br /&gt;
url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
li = xbmcgui.ListItem(&#039;My First Video!&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While not particularly exciting, this shows the minimal amount of code you need to get an XBMC add-on up and running in Python. Most important is that we first create an &amp;lt;code&amp;gt;xbmcgui.ListItem&amp;lt;/code&amp;gt; with the name and icon we want (&amp;lt;code&amp;gt;&#039;DefaultVideo.png&#039;&amp;lt;/code&amp;gt; comes from the XBMC skin), set it to be a video item, and then add it to the directory. Once we&#039;re done adding items, we need to be sure to call &amp;lt;code&amp;gt;xbmcplugin.endOfDirectory&amp;lt;/code&amp;gt; to let XBMC know we&#039;re done!&lt;br /&gt;
&lt;br /&gt;
== The entry point ==&lt;br /&gt;
&lt;br /&gt;
As we saw above, XBMC passes some arguments to us via &amp;lt;code&amp;gt;sys.argv&amp;lt;/code&amp;gt;. This is important, since it&#039;s what will let us tailor the output on the add-on based on user input. Remember, much like a web site, each folder (or page) in an XBMC add-on is the result of a separate invocation of our script. The arguments available to us are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Index !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || The base URL of your add-on, e.g. &amp;lt;code&amp;gt;&#039;plugin://plugin.video.myaddon/&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The process handle for this add-on, as a numeric string&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The query string passed to your add-on, e.g. &amp;lt;code&amp;gt;&#039;?foo=bar&amp;amp;baz=quux&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Of particular interest is &amp;lt;code&amp;gt;sys.argv[2]&amp;lt;/code&amp;gt;, which is what we&#039;ll generally use to show different things in the add-on.&lt;br /&gt;
&lt;br /&gt;
== Navigating between pages ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import urllib&lt;br /&gt;
import urlparse&lt;br /&gt;
import xbmcgui&lt;br /&gt;
import xbmcplugin&lt;br /&gt;
&lt;br /&gt;
xbmcplugin.setContent(addon_id, &#039;movies&#039;)&lt;br /&gt;
&lt;br /&gt;
base_url = sys.argv[0]&lt;br /&gt;
addon_id = int(sys.argv[1])&lt;br /&gt;
args = urlpase.parse_qs(sys.argv[2])&lt;br /&gt;
&lt;br /&gt;
def build_url(query):&lt;br /&gt;
    return base_url + &#039;?&#039; + urllib.encode(query)&lt;br /&gt;
&lt;br /&gt;
mode = args.get(&#039;mode&#039;, None)&lt;br /&gt;
&lt;br /&gt;
if mode is None:&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder One&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder One&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    url = build_url({&#039;mode&#039;: &#039;folder&#039;, &#039;foldername&#039;: &#039;Folder Two&#039;})&lt;br /&gt;
    li = xbmcgui.ListItem(&#039;Folder Two&#039;, iconImage=&#039;DefaultFolder.png&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url,&lt;br /&gt;
                                listitem=li, isFolder=True)&lt;br /&gt;
&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&lt;br /&gt;
elif mode[0] == &#039;folder&#039;:&lt;br /&gt;
    foldername = args[&#039;foldername&#039;][0]&lt;br /&gt;
    url = &#039;http://localhost/some_video.mkv&#039;&lt;br /&gt;
    li = xbmcgui.ListItem(foldername + &#039; Video&#039;, iconImage=&#039;DefaultVideo.png&#039;)&lt;br /&gt;
    li.setInfo(type=&#039;video&#039;)&lt;br /&gt;
    xbmcplugin.addDirectoryItem(handle=addon_id, url=url, listitem=li)&lt;br /&gt;
    xbmcplugin.endOfDirectory(addon_id)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66655</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66655"/>
		<updated>2013-12-11T08:03:28Z</updated>

		<summary type="html">&lt;p&gt;Pline: /*  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
= Overview of addon.xml =&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.12.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.gui.webinterface&amp;lt;/code&amp;gt;&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66654</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66654"/>
		<updated>2013-12-11T06:43:56Z</updated>

		<summary type="html">&lt;p&gt;Pline: /*  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
= Overview of addon.xml =&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.12.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|xbmc.gui.webinterface&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66653</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66653"/>
		<updated>2013-12-11T04:35:50Z</updated>

		<summary type="html">&lt;p&gt;Pline: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
= Overview of addon.xml =&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.12.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|xbmc.gui.webinterface&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt; &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039;&lt;br /&gt;
|Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt; &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039;&lt;br /&gt;
|Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66652</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66652"/>
		<updated>2013-12-11T04:35:10Z</updated>

		<summary type="html">&lt;p&gt;Pline: Clean up the &amp;lt;extension&amp;gt; section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
= Overview of addon.xml =&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.12.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file for the Confluence skin extends the &amp;lt;code&amp;gt;xbmc.gui.skin&amp;lt;/code&amp;gt; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Extension point&lt;br /&gt;
!Add-on Category&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Skin&lt;br /&gt;
|-&lt;br /&gt;
|xbmc.gui.webinterface&lt;br /&gt;
|Web interface&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Services&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.albums&amp;lt;/code&amp;gt;&lt;br /&gt;
|Album information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.artists&amp;lt;/code&amp;gt;&lt;br /&gt;
|Artist information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.movies&amp;lt;/code&amp;gt;&lt;br /&gt;
|Movie information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.musicvideos&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music video information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.tvshows&amp;lt;/code&amp;gt;&lt;br /&gt;
|TV information&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.metadata.scraper.library&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.ui.screensaver&amp;lt;/code&amp;gt;&lt;br /&gt;
|Screensaver&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.player.musicviz&amp;lt;/code&amp;gt;&lt;br /&gt;
|Visualization&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Sources#What XBMC requires for your add-on|xbmc.python.script]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]&amp;lt;/code&amp;gt; &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039;&lt;br /&gt;
|Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.subtitle.module&amp;lt;/code&amp;gt; &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039;&lt;br /&gt;
|Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Lyrics&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;[[Script Library#What XBMC requires for your add-on|xbmc.python.library]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&#039;&#039;None&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt;&lt;br /&gt;
|These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;xbmc.addon.image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
{{See also|Plugin Sources}}&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is &amp;lt;code&amp;gt;xbmc.python.pluginsource&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== library attribute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; element has an extra attribute: &amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;provides&amp;gt; element ====&lt;br /&gt;
&lt;br /&gt;
The extension has an additional child element named &amp;lt;code&amp;gt;&amp;lt;provides&amp;gt;&amp;lt;/code&amp;gt;, which contains a whitespace separated list of &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;. This determines in what area (or context) of the XBMC system your addon will make itself visible in:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Provides&lt;br /&gt;
!Appears in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;&lt;br /&gt;
|Pictures&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|Music&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|Video&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;executable&amp;lt;/code&amp;gt;&lt;br /&gt;
|Programs&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;(blank)&#039;&#039;&lt;br /&gt;
|Not visible&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
This special extension point &#039;&#039;must&#039;&#039; be provided by all add-ons, and is the way that your add-on is described to users of the XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required elements ====&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Many of these elements can be translated into multiple languages and should be added once for each supported language. See the [[List of language codes (ISO-639:1988)]] for possible language strings. If there&#039;s no &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute for a translatable element, it defaults to English. However, even for English, adding the &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; attribute is recommended.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;summary&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;summary&amp;gt;&amp;lt;/code&amp;gt; elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;description&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; elements provide a more detailed summary of what the add-on does. It may be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;platform&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;platform&amp;gt;&amp;lt;/code&amp;gt; tag specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;linux&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx64&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;osx32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ios&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;windx&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;wingl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;android&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;language&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;language&amp;gt;&amp;lt;/code&amp;gt; elements indicate the language(s) of the &#039;&#039;content&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;license&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; element indicates what license is used for this add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;forum&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;forum&amp;gt;&amp;lt;/code&amp;gt; element provides the forum thread URL for this specific add-on. Leave this blank if there is no forum thread.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;forum&amp;gt;http://www.myaddonwebsite.com/forum.php?thread=12345&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;website&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;website&amp;gt;&amp;lt;/code&amp;gt; element provides the website URL for this specific add-on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;website&amp;gt;http://www.myaddonwebsite.com/&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element provides the URL for the source code for this specific add-on.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;http://github.com/someone/myaddon&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;email&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;email&amp;gt;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
&amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optional elements ====&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;disclaimer&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
One or more &amp;lt;code&amp;gt;&amp;lt;disclaimer&amp;gt;&amp;lt;/code&amp;gt; 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&#039;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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;broken&amp;gt; =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;broken&amp;gt;&amp;lt;/code&amp;gt; tag will mark the add-on as broken in the XBMC repo and provide the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Required additional information ====&lt;br /&gt;
&lt;br /&gt;
These tags will be used to provide easy navigation on our upcoming add-on front-end where you can browse through available add-ons and directly visit the forum thread, source code or contact the add-on author.&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66651</id>
		<title>Addon.xml</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Addon.xml&amp;diff=66651"/>
		<updated>2013-12-11T04:02:18Z</updated>

		<summary type="html">&lt;p&gt;Pline: Clean up the first half of this article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{frodo updated}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Every skin, script, or plugin in XBMC contains an &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; 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 XBMC. 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/plugin.&lt;br /&gt;
&lt;br /&gt;
= Overview of addon.xml =&lt;br /&gt;
&lt;br /&gt;
Every &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; file has the same basic structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;your.addon.id&amp;quot; name=&amp;quot;Your Add-on&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;You&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;addon.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;video&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s summary&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Your add-on&#039;s description&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few important things to note in the above sample:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element must be present, and be the root node. It presents data about the add-on package as a whole.&lt;br /&gt;
* Inside the &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element is a &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element, listing all the dependencies that this add-on needs in order to function.&lt;br /&gt;
* Then there are one or more &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; elements, each of which describes a part of XBMC that the add-on extends.&lt;br /&gt;
* Finally, there is a specific &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element that extends &amp;lt;code&amp;gt;&amp;quot;xbmc.addon.metadata&amp;quot;&amp;lt;/code&amp;gt;. This describes the add-on to the user.&lt;br /&gt;
&lt;br /&gt;
= Elements =&lt;br /&gt;
 &lt;br /&gt;
== &amp;lt;addon&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;addon&amp;gt;&amp;lt;/code&amp;gt; element has 4 attributes, all required: &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provider-name&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;script.hello.world&amp;quot; name=&amp;quot;Hello World&amp;quot; version=&amp;quot;0.0.1&amp;quot; provider-name=&amp;quot;Dev1, Dev2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== id attribute ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;type&amp;gt;.&amp;lt;uniquename&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The version attribute is used by XBMC to determine whether updates are available. This should be use a version scheme like &amp;lt;code&amp;gt;x.y.z&amp;lt;/code&amp;gt; (major.minor.patch). For example: &amp;lt;code&amp;gt;version=&amp;quot;0.0.1&amp;quot;&amp;lt;/code&amp;gt;. Generally, you&#039;ll start with a version of &amp;lt;code&amp;gt;0.y.z&amp;lt;/code&amp;gt; for test releases and once you feel it is ready for a full release, you&#039;d bump the version to &amp;lt;code&amp;gt;1.0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== How versioning works ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3&amp;lt;/code&amp;gt;   is newer than &amp;lt;code&amp;gt;2.2.9&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.3.0&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is older than &amp;lt;code&amp;gt;2.2.1b&amp;lt;/code&amp;gt; &#039;&#039;(only one character =&amp;gt; newer version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1bc&amp;lt;/code&amp;gt; &#039;&#039;(two or more characters =&amp;gt; older version)&#039;&#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1 beta&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;2.2.1&amp;lt;/code&amp;gt; is newer than &amp;lt;code&amp;gt;2.2.1beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tip|Text should only be added for a beta or release version. In other cases version number should only contain numbers.}}&lt;br /&gt;
&lt;br /&gt;
=== name attribute ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== provider-name attribute ===&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;requires&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; element contains one or more &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; 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 XBMC itself, or may be parts of other third-party add-ons.&lt;br /&gt;
&lt;br /&gt;
XBMC 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 XBMC&#039;s add-on manager, XBMC 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.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here is a sample &amp;lt;code&amp;gt;&amp;lt;requires&amp;gt;&amp;lt;/code&amp;gt; block that imports two required modules and one optional one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;requires&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s another example, which will only install on OpenELEC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
        &amp;lt;import addon=&amp;quot;os.openelec.tv&amp;quot; version=&amp;quot;2.0&amp;quot; optional=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/requires&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;import&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element describes one dependency for an add-on, with two required attributes: &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;. There is also an optional attribute called, fittingly, &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If your add-on relies on other third-party add-ons, XBMC will automatically install them as well, provided they are available on an existing add-on repository. If they aren&#039;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&#039;t be loaded with an &amp;lt;code&amp;gt;&amp;lt;import&amp;gt;&amp;lt;/code&amp;gt; element, since XBMC wouldn&#039;t know what to do with them.&lt;br /&gt;
&lt;br /&gt;
=== addon attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addon&amp;lt;/code&amp;gt; attribute specifies the id of the required add-on, e.g. &amp;lt;code&amp;gt;script.module.elementtree&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== version attribute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; attribute specifies the minimum version of the required add-on to be installed.&lt;br /&gt;
&lt;br /&gt;
==== Dependency versions ====&lt;br /&gt;
&lt;br /&gt;
Each different XBMC version might require you to use a higher version of the &amp;lt;code&amp;gt;xbmc.*&amp;lt;/code&amp;gt; add-on dependencies to control on which version of XBMC the add-on can be installed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Current versions&lt;br /&gt;
! XBMC version !! xbmc.python !! xbmc.gui !! xbmc.json !! xbmc.metadata !! xbmc.addon&lt;br /&gt;
|-&lt;br /&gt;
| Dharma 10.1 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Deprecated&amp;lt;/font&amp;gt;|| 1.0 || 2.11 || 2.0|| 1.0 || 0.1&lt;br /&gt;
|-&lt;br /&gt;
| Eden 11.0 || 2.0 || 3.0 || 4.0 || 1.0 || 11.0&lt;br /&gt;
|-&lt;br /&gt;
| Frodo 12.0 &amp;amp; 12.1 &amp;amp; 12.2 || 2.1.0 || 4.0.0 || 6.0.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|-&lt;br /&gt;
| Gotham 13.0 || 2.12.0 || 5.0.1 || 6.6.0 || 2.1.0 || 12.0.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== optional attribute ===&lt;br /&gt;
&lt;br /&gt;
The dependency may be made optional by setting the &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt; attribute to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;extension&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; element describes the technical aspects of this add-on. It will have at least a point attribute which will give the part of XBMC that the add-on extends. For instance, the addon.xml file for the Confluence skin extends the &amp;quot;xbmc.gui.skin&amp;quot; part of XBMC. All available extension points are given below.&lt;br /&gt;
&lt;br /&gt;
The various extension points that XBMC provides are given in the list below.&lt;br /&gt;
{| class=&amp;quot;datatable&amp;quot;&lt;br /&gt;
|- align=left&lt;br /&gt;
! Extension point !! Addon Category&lt;br /&gt;
|-&lt;br /&gt;
| [[Add-ons for XBMC (Development)#addon.xml|xbmc.gui.skin]] || Skin&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.gui.webinterface || Web interface&lt;br /&gt;
|-&lt;br /&gt;
| [[Add-ons for XBMC (Developement)#Repository Add-on|xbmc.addon.repository]] || &amp;lt;None&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[HOW-TO:_Automatically_start_addons_using_services|xbmc.service]] || Services&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.metadata.scraper.albums || Album information&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.metadata.scraper.artists || Artist information&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.metadata.scraper.movies || Movie information&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.metadata.scraper.musicvideos || Music video information&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.metadata.scraper.tvshows || TV information&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.metadata.scraper.library || &amp;lt;None&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.ui.screensaver || Screensaver&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.player.musicviz || Visualization&lt;br /&gt;
|-&lt;br /&gt;
| [[Plugin Sources#What XBMC requires for your add-on|xbmc.python.pluginsource]] || Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
| [[Script Sources#What XBMC requires for your add-on|xbmc.python.script]] || Music Add-ons (audio) / Picture Add-ons (image) / Program Add-ons (executable) / Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.python.weather || Weather&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
| [[Script Subtitles#What XBMC requires for your add-on|xbmc.python.subtitles]]  &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham removal]])&#039;&#039;&#039; || Subtitles&lt;br /&gt;
|-{{Gotham row}}&lt;br /&gt;
| xbmc.subtitle.module  &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039; || Subtitle service module&lt;br /&gt;
|-&lt;br /&gt;
| [[Script Lyrics#What XBMC requires for your add-on|xbmc.python.lyrics]] || Lyrics&lt;br /&gt;
|-&lt;br /&gt;
| [[Script Library#What XBMC requires for your add-on|xbmc.python.library]] || &amp;lt;None&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.python.module || These don&#039;t show up in the addon browser and are purely as support for other scripts.&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.addon.video || Video Add-ons (video)&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.addon.audio || Music Add-ons (audio)&lt;br /&gt;
|-&lt;br /&gt;
| xbmc.addon.image || Picture Add-ons (image)&lt;br /&gt;
|}&lt;br /&gt;
Add-ons that don&#039;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.&lt;br /&gt;
&lt;br /&gt;
=== xbmc.python.pluginsource ===&lt;br /&gt;
&lt;br /&gt;
The most common extension point that will be used by plugin addon developers is&lt;br /&gt;
&amp;quot;xbmc.python.pluginsource&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot;&amp;gt; tag has an extra attribute &amp;quot;library&amp;quot;. This is the name of the python script (startup script) that will be run when the plugin is activated. This file must exist in the root of your addon directory.&lt;br /&gt;
The extension has an addition sub element &amp;lt;provides&amp;gt; and is a whitespace separated list of image, video, audio, executable. This&lt;br /&gt;
determines in what area (or context) of the XBMC system your addon will make itself visible in.&lt;br /&gt;
:* image =&amp;gt; Pictures&lt;br /&gt;
:* video =&amp;gt; Video&lt;br /&gt;
:* audio =&amp;gt; Music&lt;br /&gt;
:* executable =&amp;gt; Programs&lt;br /&gt;
:* &amp;lt;blank&amp;gt; =&amp;gt; No visible presence&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;extension point=&amp;quot;xbmc.python.pluginsource&amp;quot; library=&amp;quot;gpodderxbmc.py&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;provides&amp;gt;audio video&amp;lt;/provides&amp;gt;&lt;br /&gt;
    &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info on [[Plugin Sources]]&lt;br /&gt;
&lt;br /&gt;
=== xbmc.addon.metadata ===&lt;br /&gt;
&lt;br /&gt;
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 XBMC add-on manager.&lt;br /&gt;
&lt;br /&gt;
==== Required information ====&lt;br /&gt;
&lt;br /&gt;
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 minmum.:&lt;br /&gt;
* One or more summary elements provide a short summary of what the add-on does. This should be a single sentence. It may be translated into multiple languages, whereby each has a lang=&amp;quot;ch&amp;quot; attribute. No lang attribute indicates English but is recommended.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script.&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* One or more description elements provide a more detailed summary of what the add-on does. Again, these can be translated.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Hello World script provides some basic examples on how to create your first script&lt;br /&gt;
 and hopefully will increase the number of XBMC users to start creating their own addons.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* One or more disclaimer elements that indicate what (if any) things the user should know about the add-on. There is no need to have a disclaimer if you don&#039;t want one, though if something requires settings, or only works in a particular country then you may want to state this here.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Feel free to use this script. For information visit the wiki.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A platform tag which specifies which platforms (operating systems, hardware) this add-on runs on. Many add-ons will run on all platforms, so &amp;quot;all&amp;quot; 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:&lt;br /&gt;
::* all&lt;br /&gt;
::* linux&lt;br /&gt;
::* osx&lt;br /&gt;
::* osx64&lt;br /&gt;
::* osx32&lt;br /&gt;
::* ios&lt;br /&gt;
::* windx&lt;br /&gt;
::* wingl&lt;br /&gt;
::* android&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Language tag(s). These are 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.&lt;br /&gt;
[[List of language codes (ISO-639:1988)]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;en de fr&amp;lt;/language&amp;gt;&lt;br /&gt;
    or&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Broken tag. This will mark the add-on as broken in the XBMC repo with providing the reason why. You don&#039;t need to do a version bump for this to work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;broken&amp;gt;deprecated&amp;lt;/broken&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Required additional information ====&lt;br /&gt;
&lt;br /&gt;
These tags will be used to provide easy navigation on our upcoming add-on front-end where you can browse through available add-ons and directly visit the forum thread, source code or contact the add-on author.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* License tag that indicate what license is used for this add-on.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Forum tag. This this provide the forum thread URL for this specific add-on.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;put URL here&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Website tag. This provides the website URL for this specific add-on.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;put URL here&amp;lt;/website&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Source tag. This provides the source code location URL for this specific add-on.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;put URL here&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* E-mail tag. This provides the e-mail adress 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). NOTE: e-mail address can be left blank if you do not want to make it public.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;foo@bar.com&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;foo at bar dot com&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Skin specific elements ==&lt;br /&gt;
=== Overview ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|  &#039;&#039;&#039;defaultresolution&#039;&#039;&#039;&lt;br /&gt;
|  Default resolution folder for this skin. This is the base directory that all window xml file requests will fall back to.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultresolutionwide&#039;&#039;&#039;&lt;br /&gt;
|  Default widescreen resolution folder for this skin. This is the directory that all window xml file requests from widescreen resolutions (1080i, 720p, 480p 16x9, NTSC 16x9 and PAL 16x9) will fallback to. If the file isn&#039;t found in this window, then it&#039;ll fall back to the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;defaultthemename&#039;&#039;&#039;&lt;br /&gt;
|  Default theme name.  Currently set to: Default.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;effectslowdown&#039;&#039;&#039;&lt;br /&gt;
|  A multiplier that is applied to all &amp;lt;animation&amp;gt; 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.&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;debugging&#039;&#039;&#039;&lt;br /&gt;
|  When set to true, it&#039;ll display onscreen debug information (xml filename, mouse position and focused control type and name) in the skin.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|  &#039;&#039;&#039;res&#039;&#039;&#039;&lt;br /&gt;
|  Support for arbitrary skin resolutions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How window xml files are found ===&lt;br /&gt;
&lt;br /&gt;
XBMC 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 &amp;lt;width&amp;gt; and &amp;lt;height&amp;gt; tags. That way, XBMC can scale the controls to the new screen resolution.&lt;br /&gt;
&lt;br /&gt;
However, you may choose to develop alternative window xml files for differing resolutions (such as for HDTV resolutions, or for widescreen versus 4x3 resolutions).&lt;br /&gt;
&lt;br /&gt;
The order that XBMC looks for it&#039;s skin files are as follows:&lt;br /&gt;
&lt;br /&gt;
# It first looks in the current screenmode folder (one of 1080i, 720p, NTSC16x9, NTSC, PAL16x9 or PAL)&lt;br /&gt;
# If the current screenmode is 1080i, it then looks in the 720p folder.&lt;br /&gt;
# If the current screenmode is a widescreen mode (1080i, 720p, NTSC16x9, PAL16x9) then it looks in the &amp;lt;defaultresolutionwide&amp;gt; folder.&lt;br /&gt;
# Finally, it looks in the &amp;lt;defaultresolution&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
This allows you to just put any window files that do not require special treatment for 16x9 resolutions etc. in the &amp;lt;defaultresolution&amp;gt; folder, preventing needless repetition.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== addon.xml for skins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
﻿&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
  id=&amp;quot;skin.confluence&amp;quot;&lt;br /&gt;
  version=&amp;quot;2.1.3&amp;quot;&lt;br /&gt;
  name=&amp;quot;Confluence&amp;quot;&lt;br /&gt;
  provider-name=&amp;quot;Jezz_X, Team XBMC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.gui&amp;quot; version=&amp;quot;4.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension&lt;br /&gt;
    point=&amp;quot;xbmc.gui.skin&amp;quot;&lt;br /&gt;
    defaultthemename=&amp;quot;textures.xbt&amp;quot;&lt;br /&gt;
    debugging=&amp;quot;false&amp;quot;&lt;br /&gt;
    effectslowdown=&amp;quot;0.75&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;res width=&amp;quot;1280&amp;quot; height=&amp;quot;720&amp;quot; aspect=&amp;quot;16:9&amp;quot; default=&amp;quot;true&amp;quot; folder=&amp;quot;720p&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Confluence skin by Jezz_X. (XBMC&#039;s default skin)&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC 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 XBMC users to understand and use.&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;Confluence is the default skin for XBMC, removing it may cause issues&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
One thing to note is that &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;all tag names are lower case.&amp;lt;/font&amp;gt; XML tag names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
== addon.xml for scripts/plugins ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon&lt;br /&gt;
    id=&amp;quot;script.artwork.downloader&amp;quot;&lt;br /&gt;
    name=&amp;quot;Artwork Downloader&amp;quot;&lt;br /&gt;
    version=&amp;quot;12.0.12&amp;quot;&lt;br /&gt;
    provider-name=&amp;quot;Martijn&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;requires&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.python&amp;quot;                 version=&amp;quot;2.1.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.json&amp;quot;                   version=&amp;quot;6.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;xbmc.addon&amp;quot;                  version=&amp;quot;12.0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.elementtree&amp;quot;   version=&amp;quot;1.2.7&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.module.simplejson&amp;quot;    version=&amp;quot;2.0.10&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;import addon=&amp;quot;script.common.plugin.cache&amp;quot;  version=&amp;quot;1.3.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/requires&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.python.script&amp;quot;         library=&amp;quot;default.py&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;provides&amp;gt;executable&amp;lt;/provides&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.service&amp;quot; library=&amp;quot;service.py&amp;quot; start=&amp;quot;login&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;summary lang=&amp;quot;en&amp;quot;&amp;gt;Downloads Artwork for TV shows, Movies and Musicvideos in your library&amp;lt;/summary&amp;gt;&lt;br /&gt;
    &amp;lt;description lang=&amp;quot;en&amp;quot;&amp;gt;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&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;disclaimer lang=&amp;quot;en&amp;quot;&amp;gt;For bugs, requests or general questions visit the Artwork Downloader thread on the XBMC forum.&amp;lt;/disclaimer&amp;gt;&lt;br /&gt;
    &amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;platform&amp;gt;all&amp;lt;/platform&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
    &amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
    &amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
    &amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
  &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Schema Definition =&lt;br /&gt;
&lt;br /&gt;
The XML schema definition for &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; is located [https://github.com/xbmc/xbmc/blob/master/addons/xbmc.addon/metadata.xsd here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66589</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66589"/>
		<updated>2013-12-09T23:30:24Z</updated>

		<summary type="html">&lt;p&gt;Pline: Make the format for add-on dirs follow the format we specify (read: no caps)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addon-type&amp;gt;[.&amp;lt;media-type&amp;gt;].&amp;lt;your-plugin-name&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon-type&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;media-type&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;media-type&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   data/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}&lt;br /&gt;
&lt;br /&gt;
This file should contain the text of whatever software license you&#039;ve chosen to release your add-on under (e.g. GPLv2).&lt;br /&gt;
&lt;br /&gt;
=== resources/ ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subdirectory is the preferred place to put any files that the add-on uses that don&#039;t need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
==== resources/settings.xml ====&lt;br /&gt;
{{See also|Addon Settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== resources/language/ ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
==== resources/lib/ ====&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
==== resources/data/ ====&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
==== resources/media/ ====&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66588</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66588"/>
		<updated>2013-12-09T23:27:19Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Directory structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   data/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}&lt;br /&gt;
&lt;br /&gt;
This file should contain the text of whatever software license you&#039;ve chosen to release your add-on under (e.g. GPLv2).&lt;br /&gt;
&lt;br /&gt;
=== resources/ ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subdirectory is the preferred place to put any files that the add-on uses that don&#039;t need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
==== resources/settings.xml ====&lt;br /&gt;
{{See also|Addon Settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== resources/language/ ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
==== resources/lib/ ====&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
==== resources/data/ ====&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
==== resources/media/ ====&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66587</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66587"/>
		<updated>2013-12-09T23:22:09Z</updated>

		<summary type="html">&lt;p&gt;Pline: Fix the link for the repository guidelines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
{{See also|Submitting_Add-ons#Repository_Submission_Guidelines_-_Please_Read_Before_Submitting_Your_Addon|label 1=Repository guidelines}}&lt;br /&gt;
&lt;br /&gt;
This file should contain the text of whatever software license you&#039;ve chosen to release your add-on under (e.g. GPLv2).&lt;br /&gt;
&lt;br /&gt;
=== resources/ ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subdirectory is the preferred place to put any files that the add-on uses that don&#039;t need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
==== resources/settings.xml ====&lt;br /&gt;
{{See also|Addon Settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== resources/language/ ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
==== resources/lib/ ====&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
==== resources/data/ ====&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
==== resources/media/ ====&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66586</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66586"/>
		<updated>2013-12-09T23:19:13Z</updated>

		<summary type="html">&lt;p&gt;Pline: Discuss resources/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
&lt;br /&gt;
See [[Official add-on repository#Repository guidelines|repository guidelines]].&lt;br /&gt;
&lt;br /&gt;
=== resources/ ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subdirectory is the preferred place to put any files that the add-on uses that don&#039;t need to be stored in the root directory. For instance, translations, software libraries, and image resources would go in &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
==== resources/settings.xml ====&lt;br /&gt;
{{See also|Addon Settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== resources/language/ ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
==== resources/lib/ ====&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
==== resources/data/ ====&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
==== resources/media/ ====&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66585</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66585"/>
		<updated>2013-12-09T23:15:12Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* Directory structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories. Also remember, all the above is a &#039;&#039;recommended&#039;&#039; outline for your add-on; if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. For instance, skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
&lt;br /&gt;
See [[Official add-on repository#Repository guidelines|repository guidelines]].&lt;br /&gt;
&lt;br /&gt;
=== resources/settings.xml ===&lt;br /&gt;
{{See also|Addon Settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== resources/language/ ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
=== resources/lib/ ===&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
=== resources/data/ ===&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
=== resources/media/ ===&lt;br /&gt;
&lt;br /&gt;
Store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66584</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66584"/>
		<updated>2013-12-09T23:11:10Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* resources/settings.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
&lt;br /&gt;
See [[Official add-on repository#Repository guidelines|repository guidelines]].&lt;br /&gt;
&lt;br /&gt;
=== resources/settings.xml ===&lt;br /&gt;
{{See also|Addon Settings}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== resources/language/ ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
=== resources/lib/ ===&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
=== resources/data/ ===&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
=== resources/media/ ===&lt;br /&gt;
&lt;br /&gt;
store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
Remember, the above is a recommended outline for your add-on – if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. Skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66583</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66583"/>
		<updated>2013-12-09T23:05:47Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* addon.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
{{See also|addon.xml}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; gives XBMC important metadata about your add-on, such as:&lt;br /&gt;
* what the add-on provides&lt;br /&gt;
* what the add-on relies on to work&lt;br /&gt;
* what script to run when it is fired up (if it is meant to be started)&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
&lt;br /&gt;
See [[Official add-on repository#Repository guidelines|repository guidelines]].&lt;br /&gt;
&lt;br /&gt;
=== resources/settings.xml ===&lt;br /&gt;
&lt;br /&gt;
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. For more information about the format see [[Addon Settings]].&lt;br /&gt;
&lt;br /&gt;
=== resources/language/ ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
=== resources/lib/ ===&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
=== resources/data/ ===&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
=== resources/media/ ===&lt;br /&gt;
&lt;br /&gt;
store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
Remember, the above is a recommended outline for your add-on – if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. Skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66579</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66579"/>
		<updated>2013-12-09T22:59:03Z</updated>

		<summary type="html">&lt;p&gt;Pline: Remove irrelevant cross-reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; tells XBMC&lt;br /&gt;
:* what the add-on provides&lt;br /&gt;
:* what the add-on relies on to work&lt;br /&gt;
:* what script to run when it is fired up (if it is meant to be started.)&lt;br /&gt;
&lt;br /&gt;
More information on formatting can be found here: [[addon.xml]]&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
&lt;br /&gt;
See [[Official add-on repository#Repository guidelines|repository guidelines]].&lt;br /&gt;
&lt;br /&gt;
=== resources/settings.xml ===&lt;br /&gt;
&lt;br /&gt;
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. For more information about the format see [[Addon Settings]].&lt;br /&gt;
&lt;br /&gt;
=== resources/language/ ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
=== resources/lib/ ===&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
=== resources/data/ ===&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
=== resources/media/ ===&lt;br /&gt;
&lt;br /&gt;
store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
Remember, the above is a recommended outline for your add-on – if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. Skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66578</id>
		<title>Add-on structure</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_structure&amp;diff=66578"/>
		<updated>2013-12-09T22:58:33Z</updated>

		<summary type="html">&lt;p&gt;Pline: /* addon.py */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the add-ons system introduced in the Dharma release (v10) of XBMC.  This system allows 3rd party-developed enhancements to XBMC to be distributed to XBMC users directly from inside the XBMC interface.&lt;br /&gt;
&lt;br /&gt;
The add-ons system is based on the plugin library [http://www.c-pluff.org c-pluff].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Each add-on is kept in its own folder, and is described via an XML file named &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;.  In addition, some other files can also come with the add-on, such as &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;changelog.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;fanart.jpg&amp;lt;/code&amp;gt;.  These are all optional, though we encourage you to at least have &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;.  All of these reside in the &amp;quot;root&amp;quot; of the folder that contains the add-on.  Additional data may be contained within a &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; subfolder, such as language translations and descriptions of settings.&lt;br /&gt;
&lt;br /&gt;
When installed, the whole add-on folder will be placed inside &amp;lt;code&amp;gt;.xbmc/addons/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory Name ==&lt;br /&gt;
&lt;br /&gt;
Your directory name should follow this convention: &amp;lt;code&amp;gt;&amp;lt;addonType&amp;gt;[.&amp;lt;mediaType&amp;gt;].&amp;lt;yourPluginName&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addonType&amp;lt;/code&amp;gt; is one of the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Description&lt;br /&gt;
!Media Type Required?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt;&lt;br /&gt;
|A repository definition file that allows users to add new repositories to the XBMC addon manager.&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|A plugin script or module that adds to the functionality of XBMC. Plugins appear under the relevant media section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|A runnable program file that will appear in the Program section of the main home menu.&lt;br /&gt;
|&#039;&#039;&#039;Yes&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;skin&amp;lt;/code&amp;gt;&lt;br /&gt;
|An XBMC skin definition and its supporting script files.&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table describes the available &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt;s for the available add-on types. Your add-on may provide more than one &amp;lt;code&amp;gt;mediaType&amp;lt;/code&amp;gt; if&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Add-on Type&lt;br /&gt;
!Media Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;&lt;br /&gt;
|A music add-on that will appear in the Music main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
|A video add-on that will appear in the Video main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;&lt;br /&gt;
|A picture add-on that will appear in the Pictures main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;weather&amp;lt;/code&amp;gt;&lt;br /&gt;
|A weather add-on that will appear in the Weather main menu.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script plugin that will not appear under a category or within the Add-ons manager, but provides support for other add-ons.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;service&amp;lt;/code&amp;gt;&lt;br /&gt;
|A script that will be run at either login or startup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See section on [[Add-on development#addon.xml|addon.xml]] for further information&lt;br /&gt;
&lt;br /&gt;
The add-on name is up to you, but be sure that it isn&#039;t already in use by another add-on. For instance, if you are creating an add-on that integrates the Gpodder software with XBMC for audio podcasts you might name your directory &amp;lt;code&amp;gt;plugin.audio.gpodder-xbmc3&amp;lt;/code&amp;gt;. If you are creating a screen scraper to present TV shows from MyGreatTv.com. It might be &amp;lt;code&amp;gt;plugin.video.my-great-tv-com&amp;lt;/code&amp;gt;. A script to ping all your friends on twitter to tell them you are home might be called&lt;br /&gt;
&amp;lt;code&amp;gt;script.service.ping-twits-i-am-home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 addon.py&lt;br /&gt;
 addon.xml&lt;br /&gt;
 changelog.txt&lt;br /&gt;
 fanart.jpg&lt;br /&gt;
 icon.png&lt;br /&gt;
 LICENSE.txt&lt;br /&gt;
 resources/&lt;br /&gt;
   settings.xml&lt;br /&gt;
   language/&lt;br /&gt;
   lib/&lt;br /&gt;
   media/&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;lib/&amp;lt;/code&amp;gt; folder. If those libs are commonly used by multiple add-ons, consider adding them as a separate add-on, e.g. &amp;lt;code&amp;gt;script.module.foo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The most important thing to remember from this is that everything that doesn&#039;t need to be in the root of your directory is considered a resource and should be placed inside &amp;lt;code&amp;gt;resources/&amp;lt;/code&amp;gt; or one of its subdirectories.&lt;br /&gt;
&lt;br /&gt;
=== addon.py ===&lt;br /&gt;
&lt;br /&gt;
This will contain the main Python code for your add-on. You can name it whatever you want, since you&#039;ll define this Python file in &amp;lt;code&amp;gt;[[addon.xml]]&amp;lt;/code&amp;gt; as your main script file.&lt;br /&gt;
&lt;br /&gt;
=== addon.xml ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; tells XBMC&lt;br /&gt;
:* what the add-on provides&lt;br /&gt;
:* what the add-on relies on to work&lt;br /&gt;
:* what script to run when it is fired up (if it is meant to be started.)&lt;br /&gt;
&lt;br /&gt;
More information on formatting can be found here: [[addon.xml]]&lt;br /&gt;
&lt;br /&gt;
=== changelog.txt ===&lt;br /&gt;
&lt;br /&gt;
A text file that contains a description of the changes you make to the add-on for each release.  This is displayed in the XBMC 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&#039;s opinion, too many add-ons skip this piece of information, making it difficult for users to determine whether a particular problem that&lt;br /&gt;
they may have been having has been fixed or not.)&lt;br /&gt;
&lt;br /&gt;
=== icon.png ===&lt;br /&gt;
&lt;br /&gt;
This is an icon used to represent your add-on in various parts of XBMC. 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:&lt;br /&gt;
&lt;br /&gt;
* The icon size must be 256x256 pixels.&lt;br /&gt;
* File format is PNG.&lt;br /&gt;
* Background must be 100% solid. That doesn&#039;t mean one color, it also can be a gradient or a low contrast texture. Just make sure there is no transparency.&lt;br /&gt;
* Keep the logo as simple a possible, no exaggerated 3D effects or high contrast textures.&lt;br /&gt;
* Use a padding of at least 25px for your logo (not the background!). Excepted are large text logos (see icon for themoviedb.org).&lt;br /&gt;
* Keep text to a minimum. However, a text logo along with the graphical logo is recommended in order to easily recognize the addon.&lt;br /&gt;
* Don&#039;t mix logos with XBMC&#039;s logo; it&#039;s obvious that we&#039;re talking about XBMC here.&lt;br /&gt;
* Don&#039;t add borders or any overlays, that&#039;s the skinner&#039;s job. However, if borders are an element of your logo, make sure there is enough padding.&lt;br /&gt;
* 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&#039;s logo &#039;&#039;as long as you are free to do so&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== fanart.jpg ===&lt;br /&gt;
&lt;br /&gt;
This helps to keep XBMC graphically rich when browsing and using add-ons. Some simple guidelines:&lt;br /&gt;
&lt;br /&gt;
* It should be 16:9 aspect ratio&lt;br /&gt;
* It is intended for the background, so should be simple and without text where reasonable.&lt;br /&gt;
* We recommend a 1280x720 JPEG image.  It should certainly be no larger than 1920x1080.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
=== LICENSE.txt ===&lt;br /&gt;
&lt;br /&gt;
See [[Official add-on repository#Repository guidelines|repository guidelines]].&lt;br /&gt;
&lt;br /&gt;
=== resources/settings.xml ===&lt;br /&gt;
&lt;br /&gt;
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. For more information about the format see [[Addon Settings]].&lt;br /&gt;
&lt;br /&gt;
=== resources/language/ ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation tools:&#039;&#039;&#039;&lt;br /&gt;
* [[Language support]]&lt;br /&gt;
* [[Translation System]]&lt;br /&gt;
* Convert .xml to .po: [https://github.com/alanwww1/xbmc-xml2po xbmc-xml2po]&lt;br /&gt;
* Check for .po files: [https://github.com/alanwww1/xbmc-checkpo xbmc-checkpo]&lt;br /&gt;
* Utility for keeping XBMC upstream language files and the language files hosted on transifex.com in sync: [https://github.com/alanwww1/xbmc-txupdate xbmc-txupdate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;String ID range:&#039;&#039;&#039;&lt;br /&gt;
* strings 30000 thru 30999 reserved for plugins and plugin settings&lt;br /&gt;
* strings 31000 thru 31999 reserved for skins&lt;br /&gt;
* strings 32000 thru 32999 reserved for scripts&lt;br /&gt;
* strings 33000 thru 33999 reserved for common strings used in add-ons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;strings.po&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|strings.xml will possibly be deprecated after the release of Frodo/Gotham. Frodo and Gotham will still be backwards compatible with .xml}}&lt;br /&gt;
&lt;br /&gt;
=== resources/lib/ ===&lt;br /&gt;
&lt;br /&gt;
Put any module definitions or third party software libraries into this directory.&lt;br /&gt;
&lt;br /&gt;
=== resources/data/ ===&lt;br /&gt;
&lt;br /&gt;
Store any other static data structures your application requires here. Examples might be&lt;br /&gt;
XLT/XSD files or static XML files that contain lookup tables etc.&lt;br /&gt;
&lt;br /&gt;
=== resources/media/ ===&lt;br /&gt;
&lt;br /&gt;
store any static media (picture, audio, video etc.) files in this directory.&lt;br /&gt;
Remember, the above is a recommended outline for your add-on – if you need fewer or more&lt;br /&gt;
directories to organise your work, just change it. Skins are add-ons that will require more directories than this.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
Following pages will explain in more depth to get started. Providing examples, background information and useful links.&lt;br /&gt;
&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Addon Development]]&lt;/div&gt;</summary>
		<author><name>Pline</name></author>
	</entry>
</feed>