Add-on repositories: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Theuni
>Jmarshall
No edit summary
Line 14: Line 14:


==Directory Structure==
==Directory Structure==
   root
   addon.id
  addons.xml
     addon.id-x.y.z.zip
     addon.name
    changelog-x.y.z.zip
        addon.name-x.y.z.zip
    fanart.jpg
        changelog-x.y.z.zip
    icon.png
        fanart.jpg
  addon2.id
        icon.png
    addon2.id-x.y.z.zip
    addon2.name
    changelog-x.y.z.zip
        addon2.name-x.y.z.zip
    fanart.jpg
        changelog-x.y.z.zip
    icon.png
        fanart.jpg
        icon.png
 
*addons.xml is the file listed in the <info> section of the addon.
*addon.name should be the same as the addon's <id>, which is expected to be unique.
*x.y.z is the addon's version, the same should be listed in its <version> tag.


*addon.id should be the same as the addon's id, which is expected to be unique.
*x.y.z is the addon's version, the same should be listed in its version attribute.




==Addons.xml==
==Addons.xml==
XBMC expects to fetch a master xml file that contains the information for each addon inside the repo. This file is named addons.xml and should be at the root of the repository. This file merely encapsulates ther other addon.xml files in an <addons> tag. See below for the basic structure:
XBMC expects to fetch a master xml file that contains the information for each addon inside the repo. This file is named addons.xml - it can be placed external to the main repository of addon files if you wish. This file merely encapsulates ther other addon.xml files in an <addons> tag. See below for the basic structure:
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Line 51: Line 47:


==Repository Addon==
==Repository Addon==
Repositories are distributed just like any other add-on. In order for you to browse one in XBMC, you'll need to create an add-on and install it. See the xbmc.org addon.xml below for reference:
Repositories are distributed just like any other add-on. In order for you to browse one in XBMC, you'll need to [[Addons for XBMC|create an add-on]] and install it. The repository addon extends the xbmc.addon.repository extension point, so in addition to the general XML structure and icons required for an icon, you'll need an <extension> block as follows:
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <extension point="xbmc.addon.repository"
<addon id="repository.xbmc.org"
              name="Official XBMC.org Add-on Repository">
                name="XBMC.org Add-ons"
    <info compressed="true">http://mirrors.xbmc.org/addons/dharma-pre/addons.xml</info>
                version="1.0.0"
    <checksum>http://mirrors.xbmc.org/addons/dharma-pre/addons.xml.md5</checksum>
                provider-name="Team XBMC">
    <datadir zip="true">http://mirrors.xbmc.org/addons/dharma-pre</datadir>
        <extension point="xbmc.addon.repository"
  </extension>
                name="Official XBMC.org Add-on Repository">
                <info compressed="true">http://mirrors.xbmc.org/addons/dharma-pre/addons.xml</info>
                <checksum>http://mirrors.xbmc.org/addons/dharma-pre/addons.xml.md5</checksum>
                <datadir zip="true">http://mirrors.xbmc.org/addons/dharma-pre</datadir>
        </extension>
        <extension point="xbmc.addon.metadata">
                <summary>Install Add-ons from XBMC.org</summary>
                <summary lang="es">Instalar Addons desde XBMC.org</summary>
                <description>Download and install add-ons from the Official XBMC.org addon repository.[CR]  By using the official Repository you will be able to take advantage of our extensive file mirror service to help get you faster downloads from a region close to you.[CR]  All addons on this repository have under gone basic testing, if you find a broken or not working addon please report it to Team XBMC so we can take any action needed.</description>
                <description lang="es">Descarga e instala Addons desde el repositorio oficial de XBMC.[CR]  Usando el repositorio oficial tendrás las ventajas de nuestro servicio de mirrors para ayudarte a conseguir unas descargas más rápidas de un sitio cercano a ti.[CR]  Todos los Addons en este repositorio han pasado por un periodo de pruebas básico, pero si encuentras algun addon que no funcione, por favor informa de ello al equipo de XBMC para que se pueda arreglar el fallo.</description>
                <disclaimer>Team XBMC did not make all the add-ons on this repository and are not responsible for their content</disclaimer>
                <disclaimer lang="es">El equipo de XBMC no ha hecho todos los Addons en este repositorio y por consecuente no són responsables de su contenido</disclaimer>
                <platform>all</platform>
        </extension>
</addon>
</source>
</source>
===<info>===
===<info>===
*info - path to the main xml file
URL to the main xml file, compressed="true" parameter specifies that XBMC may fetch a zipped version by appending .zip to the URL.
*Compressed - whether or not the xml should be fetched with compression enabled
===<checksum>===
*datadir - path to the rootdir for addons
An (optional) checksum file of the main xml file.  If present, XBMC verifies the addons.xml file against this MD5.
*zip - whether or not each addon is zipped
===<datadir>===
*checksum - whether or not the main xml should be verified against a checksum file of the same name (eg addon.xml.md5)
URL to the root directory that contains the addons (i.e. the directory holding the addon.id subdirectories).  If the zip attribute is set to true, then XBMC downloads addons via <datadir>/addon.id/addon.id.x.y.z.zip.  If zip is set to false, then XBMC assumes that each addon.id directory simply contains the addon itself, i.e. <datadir>/addon.id/<files for addon>.  Online repositories should always have zip set to true, both for efficiency of download and for the protection that .zip offers by way of verifying the download (i.e. can we unzip it).

Revision as of 03:43, 30 June 2010

Repositories

Beginning with Dharma, XBMC includes an interface to browse remote repositories where add-ons can be retrieved. The model is similar to the way many current Linux distributions work, whereby there is a "main" repository that is the default, and additional ones may be added by the user. The Official xbmc.org Repository is included with XBMC by default and is maintained by the XBMC team.

Ingredients for a Repository

Repositories were created with the idea that they should be simple and easy enough to setup for anyone interested. The basic requirements are as follows:

  • An HTTP server. Any should work.
  • Some addons.
  • A master xml file. This file contains metadata about all available add-ons.
  • (Optional) A checksum of the above file.
  • A repo addon for distribution. This allows you to share your repo with others.

Directory Structure

 addon.id
    addon.id-x.y.z.zip
    changelog-x.y.z.zip
    fanart.jpg
    icon.png
 addon2.id
    addon2.id-x.y.z.zip
    changelog-x.y.z.zip
    fanart.jpg
    icon.png
  • addon.id should be the same as the addon's id, which is expected to be unique.
  • x.y.z is the addon's version, the same should be listed in its version attribute.


Addons.xml

XBMC expects to fetch a master xml file that contains the information for each addon inside the repo. This file is named addons.xml - it can be placed external to the main repository of addon files if you wish. This file merely encapsulates ther other addon.xml files in an <addons> tag. See below for the basic structure:

<?xml version="1.0" encoding="UTF-8"?>
<addons>
  <addon
    id="sample.addon1"
    ...
  </addon>

  <addon
    id="sample.addon2"
    ...
  </addon>
</addons>

Repository Addon

Repositories are distributed just like any other add-on. In order for you to browse one in XBMC, you'll need to create an add-on and install it. The repository addon extends the xbmc.addon.repository extension point, so in addition to the general XML structure and icons required for an icon, you'll need an <extension> block as follows:

  <extension point="xbmc.addon.repository"
              name="Official XBMC.org Add-on Repository">
    <info compressed="true">http://mirrors.xbmc.org/addons/dharma-pre/addons.xml</info>
    <checksum>http://mirrors.xbmc.org/addons/dharma-pre/addons.xml.md5</checksum>
    <datadir zip="true">http://mirrors.xbmc.org/addons/dharma-pre</datadir>
  </extension>

<info>

URL to the main xml file, compressed="true" parameter specifies that XBMC may fetch a zipped version by appending .zip to the URL.

<checksum>

An (optional) checksum file of the main xml file. If present, XBMC verifies the addons.xml file against this MD5.

<datadir>

URL to the root directory that contains the addons (i.e. the directory holding the addon.id subdirectories). If the zip attribute is set to true, then XBMC downloads addons via <datadir>/addon.id/addon.id.x.y.z.zip. If zip is set to false, then XBMC assumes that each addon.id directory simply contains the addon itself, i.e. <datadir>/addon.id/<files for addon>. Online repositories should always have zip set to true, both for efficiency of download and for the protection that .zip offers by way of verifying the download (i.e. can we unzip it).