• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
addon.xml tagging
All Kodi add-ons require a specially formatted xml file to work, they are very easy to knock up and a lot of people just copy/paste existing addon.xml files from other add-ons and just change a few bits of text. While this is perfectly fine if you just want a basic add-on up and running you may find you're really missing out on some great opportunities to promote your work to the public.

If you've not already viewed it then the official addon.xml wiki page has some excellent information and it's well worth familiarising yourself with it before continuing. There are however some unique tags that aren't included in the wiki, tags that are currently only picked up by the Add-on Portal (and Community Portal) here at noobsandnerds. Lets go through the tags and explain what they all do...

Example addon.xml:

<?xml [size=small]version="1.0" encoding="UTF-8" standalone="yes"?>[/size]
<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You">
    <import addon="xbmc.python" version="2.1.0"/>
  <extension point="xbmc.python.pluginsource" library="default.py">
  <extension point="xbmc.service" library="service.py" start="startup" />
  <extension point="xbmc.addon.metadata">
    <summary lang="en_gb">Your add-on's summary</summary>
    <description lang="en_gb">Your add-on's description</description>
    <disclaimer lang="en_gb"></disclaimer>
    <genre>uk, usa, livetv</genre>

The very first line is our XML formatting, that's always going to be the same line of text and is unlikely that'll be changing any time soon so lets move onto the second line:

<addon id="plugin.addon.id" name="Your Add-on" version="1.2.3" provider-name="You">
As you can see we start off with "addon", this declares it's a valid kodi addon.
  • id= This is the id of your addon, strictly speaking you could call it whatever you want but it's good practice to keep with the naming conventions already used in Kodi development, so use script.<name>, skin.<name>, plugin.<name> etc. When choosing an id always check on the Add-on Portal here to see whether or not an add-on already exists with that ID, you really don't want to use the same ID as others as it will cause both of you real headaches!
  • name= This is the name your add-on will be displayed as inside of Kodi, so whenever referencing the add-on in any code you'd use the id but this is the name users will see.
  • version= Choose a version number, it should really be in this format: version.minor.patch. For testing you would normally start at 0.0.1 and your first full release would be 1.0.0. Different devs choose to do this in different ways but that seems to be general consensus of how it should work, as soon as you update your version number and push to your repository Kodi will know there is an update available.
  • provider-name= This would be yourself, if you've forked this from another add-on then it's only right that you also credit them in here too. If you've done a very minor adjustment to the code then you'd generally just leave the original author(s) in there and also add "modded by <name>" at the end. For multiple authors use a comma to separate them.
<requires> This tag tells Kodi what needs to be installed alongside the add-on for it to work. If you have third party add-ons/scripts defined in here the system will try and download them from the repositories already installed on the system. Obviously you cannot install something if you don't have the relevant repo installed so make sure you plan this out correctly, as a general rule if the dependency is not in the official Kodi repo then you'll need it to be available in your repo.
  • Built-in dependencies - In the example above we have xbmc.python version 2.1.0. This is actually an integral part of the Kodi system, it's the python engine used for running add-on code and different versions of Kodi use different python versions. You may have seen a message like "dependencies not met" when trying to install an add-on before, well this would more than likely be why. If the python version doesn't meet the requirements set out in the addon.xml it will fail to install. For more details on the latest versioning numbers check out the wiki.
  • Third party dependencies - Your add-on may also require other script modules or add-ons to be installed for it to work, if this is the case you can add them in here. Make sure you add a version number, this is the MINIMUM version number that needs to be installed so don't worry if you rely on min. version number 3.0 and your dependency updates to a newer version number you don't have to keep altering your addon.xml.
  • Optional dependencies - it's rare for this to be used but you can add the "optional=true" paramater to the import and it will only import the dependency as and when it's called upon. This means that you will be able to install the add-on even if the dependency can't be found.

<extension> This lets Kodi know what kind of add-on this is going to be, for example it could provide music, video, skin etc. Take a look at the official wiki page for the latest extensions available. Your add-on can have multiple extension points, you have have it run different scripts when clicked from different sections of Kodi, lets look at our example above.
  • xbmc.python.pluginsource - here we're telling Kodi that it's a common plugin and you'll see we have library="default.py", well that tells Kodi that we want the plugin to run default.py when a user tries to run it. It doesn't have to be default.py it can be anything you want but that or addon.py is the most commonly used.
  • <provides> - you'll see this is embedded between the tags for the extension point=xbmc.python.pluginsource. As mentioned we've already told it to expect a normal plugin but here we tell it what sections it should appear in. In this case we have it as executable which is the programs section. The other options for this are image, audio, video and they would only show in their respective sections. If you wanted it to open video.py when accessed from video add-ons you would just create a new extension point below this one, if you wanted it to open default.py in both video and program add-ons you could use the one extension point and just have provides as "executable video" (space separated).
  • xbmc.service - this is another fairly common extension point, however only use this if you know what you're doing as it can be very dangerous! When defining a service to run you use the same methodology as above by pointing to the script you want to open but you also tell it when you want it to run, login or startup are the obvious choices. Most scripts run on some sort of timer/loop so if you get your code wrong you can really cause problems on peoples systems so use with care!!!
xbmc.addon.metadata - Every add-on needs this, don't forget to add this as it's what Kodi uses to show the add-ons to the end user. We'll go through the options below and you'll see the optional tags used by NaN for the Add-on Portal too. They should for the most part be straight forward to understand...
  • <summary> This can be used as shown here or with the lang=<language_ISO_code> which will allow you to show different text depending on what country setting that particular Kodi system is running. The summary should be a short one liner about your add-on, it's the heading you see in the add-on description inside of Kodi.
  • <description> This can also use the language option, this should be a full description of what your add-on does. You'll be able to see this when browsing the add-ons inside of Kodi as well as on the Add-on Portal.
  • <disclaimer> (optional) Again you can use the language option if required. Add anything in here you want to add as a disclaimer, for example if you know there are bugs with a particular system you could let the users know about it with this tag.
  • <platform> Define the system the add-on is capable of running on, the vast majority will be "all" but don't get into the bad habit of defining it as "all" if there are some systems you know it won't work on. For example there are a number of things you can do on Android that you can't do on Windows, linux etc. The platforms available are: all, android, linux, osx, osx64, osx32, ios, windx, xbox.
  • <language> (optional) set the language your add-on provides. This is what the Kodi add-on manager checks when filtering things by language.
  • <license> (optional) Add details of your license here, you don't need to add the whole license just the type of license the add-on is released under. If you're forking another add-on DO NOT under any circumstances remove the license, once a license is in place it cannot be removed and it must be obeyed. The license can be added in the header of the actual code or as a license file in the root of the add-on.
  • <forum> (optional) Add a link to your forum thread, this can be any forum you like and makes giving support much easier. The link will appear on the Add-on Portal here at NaN regardless of the forum you choose to release on.
  • <website> (optional) If you want to link to a website you think would be useful in some way then you can do so here. It may be you have a subscription based add-on in which case it would make perfect sense to add details of the website. This will be linked to from the Add-on Portal.
  • <source> (optional) This was always a widely used tag which seems to have been overlooked by many new devs, although it's optional it's highly recommended to add a link to your github page (or wherever your source code is hosted). This will be linked to from the Add-on Portal.
  • <email> (optional) Rarely used these days but if you want to give contact details you can enter them here.
  • <broken> (optional) PLEASE use this to mark your add-on as broken. Do not simply delete things from your repo because they no longer work, mark up the addon.xml as broken and just add a simple line or two of why it's broken and whether or not it's likely to come back. Both Kodi and the Add-on Portal use this information so do not ignore this tag.

Add-on Portal specific tags:

<genre> - I created this so devs could get more information out there regarding their add-ons. The Add-on Portal will pick up any genre tags and then categorise the add-on into the appropriate genre sections (both on the website and Community Portal). Don’t miss out, make sure your add-ons are being incorrectly tagged and not overlooked by users – simply add the relevant genres to make sure make your add-ons always appear in the correct sections.

Full details of the genre tags available can be found here
<video_preview> - This is perfect for getting useful information out there and also making it stand out above the others, all add-ons with this tag (and a valid YouTube id inserted) will have their videos displayed on both the Add-on Portal and from within the Community Portal add-on.

<video_guide> - As you might have guessed this is the same as above but is a placeholder for an actual guide opposed to a preview. Ideally your preview would be pretty short and sweet just showing what the add-on provides and then your guide would explain how to actually use it.

Below is an example of how to use the video tags:

<description>TV Portal EPG</description>

The actual URL for the YouTube video linked above is: https://www.youtube.com/watch?v=WdKIzajiBBI
The id used in these video tags is the section after watch?v=
The above example will show a video preview but we can of course also use the video_guide tag for a proper guide on how to use the add-on.
You can always add more guides via the web form on the Add-on Portal.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Scraper addon Universe addon 1 159 10-14-2017, 07:14 AM
Last Post: whufclee
  Live TV addon TonyH 10 180 09-26-2017, 08:45 AM
Last Post: whufclee
  error when trying to open addon keepforgettingmypassword 5 85 09-20-2017, 02:26 PM
Last Post: keepforgettingmypassword
  creating a search feature in addon streemz 10 143 09-04-2017, 07:50 PM
Last Post: streemz
  how can i import pyqt4 in my addon naveengautam002 1 41 08-15-2017, 10:55 AM
Last Post: whufclee
  installing scripts required for addon BigYid 5 76 08-05-2017, 11:51 AM
Last Post: whufclee
  How to submit an addon to the Add-on Portal whufclee 11 3,052 08-04-2017, 10:44 PM
Last Post: BigYid
  Create Repo / Addon for " TV MUCHO" bicky 2 67 07-28-2017, 05:37 PM
Last Post: bicky
  Addon created, now how do I add content to it? PJD1976 1 57 07-26-2017, 01:15 PM
Last Post: whufclee
  Create Your First Addon whufclee 17 4,041 05-08-2017, 09:34 AM
Last Post: whufclee

Forum Jump:

Users browsing this thread: 1 Guest(s)