https://kodi.wiki/api.php?action=feedcontributions&user=SistemaRayoXP&feedformat=atomOfficial Kodi Wiki - User contributions [en]2024-03-28T20:00:50ZUser contributionsMediaWiki 1.39.6https://kodi.wiki/index.php?title=Add-on_development&diff=248005Add-on development2023-10-18T08:09:48Z<p>SistemaRayoXP: Grammar</p>
<hr />
<div>{{mininav|[[Development]]}}<br />
[[File:Wiki logo.png|150px|link=|left]]<br />
<section begin="intro" />This area contains information, tutorials, and links for creating add-ons (and plug-ins) for Kodi.<section end="intro" /><br />
<br />
{{-}}<br />
----<br />
{{huge|'''{{color|black|General}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="16%" align="center" | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}<br />
| width="17%" align="center" | {{Main page icon|image=Administration.png|link=Add-on settings}}<br />
| width="16%" align="center" | {{Main page icon|image=Applications-development.png|link=Add-on structure|title=Add-on Structure}}<br />
| width="17%" align="center" | {{Main page icon|image=Tool-box-icon.png|link=Development Tools}}<br />
| width="18%" align="center" | {{Main page icon|image=Translation - Noun project 987.png|link=Language portal|title=Languages &amp; Translations}}<br />
| width="16%" align="center" | {{Main page icon|image=60.jpg|link=Special protocol}}<br />
|}<br />
<br />
----<br />
{{huge|'''{{color|black|Add-on Types}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="12.5%" align="center" | {{Main page icon|image=Nuvola apps kthememgr.png|link=Plugin sources}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Misc-Misc-Box-icon.png|link=Add-on_repositories|title=Repository add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Web-icon.png|link=HOW-TO:Write media scrapers|title=Scraper add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Applications-development.png|link=Script sources|title=Scripts}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Administration.png|link=Script subtitles|title=Subtitle scripts}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Gnome-system-run.png|link=Service add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Weather_addon.png|link=Weather addons|title=Weather add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=UI_sounds.png|link=UI sounds add-ons}}<br />
|}<br />
<br />
----<br />
{{huge|'''{{color|black|Tutorials}}'''}}<br />
<br />
{| width="100%"<br />
|- valign="top"<br />
| width="12.5%" align="center" | {{Main page icon|image=music-icon.png|link=HOW-TO:Audio_addon|title=Audio Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=context-menu-icon.png|link=Context_Item_Add-ons|title=Context Item Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Addons-icon.png|link=Audio-video_add-on_tutorial|title=General Add-on Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Translation - Noun project 987.png|link=HOW-TO:HelloWorld_addon|title=Hello World Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Screensaver-icon.png|link=HOW-TO:Screensaver_addon|title=Screensaver Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=script-icon.png|link=HOW-TO:Script_addon|title=Script Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Visualisation-icon.jpg|link=HOW-TO:Visualisation_addon|title=Visualisation Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=video-icon.png|link=HOW-TO:Video_addon|title=Video Addon Tutorial}}<br />
|}<br />
----<br />
{{huge|'''{{color|black|Advanced}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="12.5%" align="center" | {{Main page icon|image=Unicode icon.jpg|link=Add-on unicode paths}}<br />
| width="12.5%" align="center" | {{Main page icon|image=501159.png|link=JSON-RPC API}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Book icon 1.png|link=Python_libraries|title=Kodi Python Libraries}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Boolean_operation_icon.jpg|link=List of boolean conditions}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Apps-Brackets-B-icon.png|link=List of built-in functions}}<br />
| width="12.5%" align="center" | {{Main page icon|image=shopping-list-generator-icon.png|link=InfoLabels|title=List of info labels}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Web-pdb-icon.png|link=Python_debugging|title=Python Debugging}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Windowsicon.png|link=Window IDs|title=Window IDs}}<br />
|}<br />
<br />
----<br />
{{huge|'''{{color|black|Publishing}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="25%" align="center" | {{Main page icon|image=Thumbs up font awesome.png|link=Add-on rules}}<br />
| width="25%" align="center" | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}<br />
| width="25%" align="center" | {{Main page icon|image=Thumbnail-symbol-transparent.png|link=Official_add-on_repository|title=Official Add-on Repository}}<br />
| width="25%" align="center" | {{Main page icon|image=Box_icon.png|link=Unofficial add-on repositories|title=Third-party Add-on Repositories}}<br />
|}<br />
----<br />
<br />
<br />
[[Category:Add-on development|*]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=Context_Item_Add-ons&diff=235219Context Item Add-ons2021-10-03T19:36:29Z<p>SistemaRayoXP: Added mininav</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
<br />
Context item add-ons extend the Kodi [[context menu]] with useful actions not present in Kodi by default.<br />
<br />
= Introduction =<br />
<br />
Context item add-ons must provide the <code>kodi.context.item</code> extension point and a <menu> definition. <br />
<br />
Example:<br />
<br />
<syntaxhighlight lang="xml"><br />
<extension point="kodi.context.item"><br />
<menu id="kodi.core.main"><br />
<item library="contextitem.py"><br />
<label>30000</label><br />
<visible>true</visible><br />
</item><br />
</menu><br />
</extension><br />
</syntaxhighlight><br />
<br />
The first '''<menu>''' element defines which top level menu to attach to. In core, there are two available: <code>kodi.core.main</code> and <code>kodi.core.manage</code>. Add-ons may attach to a menu defined by other add-ons as well.<br />
<br />
Next, the '''<item>''' element defines the action to add to perform when the user selects the item. It is specified my assigning the name of a Python script file to the <code>library</code> attribute. Each menu item needs to have a unique <code>library</code> value (Duplicate items are ignored).<br />
<br />
'''<label>''' is a string, or an ID from the language file, that specifies the text that is shown in the context menu item, on the screen.<br />
<br />
'''<visible>''' is required, and should contain a [[Conditional visibility|visibility expression]], which will determine if (or when) the item is visible in the [[context menu]]. <br />
<br />
This feature requires at least version 2.23.0 of the Python API (Jarvis), which should be specified in the [[Addon.xml#<requires>]] element:<br />
<syntaxhighlight lang="xml"><br />
<import addon="xbmc.python" version="2.23.0"/><br />
</syntaxhighlight><br />
<br />
{{note|Kodi v19 Matrix and later.}}<br />
<br />
In Kodi v19 Matrix and later, it is possible to specify an optional <code>args</code> attribute to a context item. The contents of this attribute will be passed as an argument to the script specified in the <code>library</code> attribute. It can be accessed via <code>sys.argv</code>. The combination of <code>args</code> and <code>library</code> need to be unique. Duplicate combinations are ignored.<br />
<br />
<syntaxhighlight lang="xml"><br />
<extension point="kodi.context.item"><br />
<menu id="kodi.core.main"><br />
<item library="contextitem.py" args="command_arg"><br />
<label>30000</label><br />
<visible>true</visible><br />
</item><br />
</menu><br />
</extension><br />
</syntaxhighlight><br />
<br />
{{Note|Keep in mind that there is limited space in the [[context menu]]. Attaching a context menu to an add-on will force the user to have all of them enabled at the same time. Consider using [[#Submenus]], or creating a separate add-on.}}<br />
<br />
<br />
= Submenus =<br />
<br />
<menu> and <item> elements may be mixed and nested to created submenus. Example:<br />
<br />
<syntaxhighlight lang="xml"><br />
<menu id="kodi.core.main"><br />
<menu><br />
<label>My submenu</label><br />
<item library="contextitem1.py"><br />
<label>30001</label><br />
<visible>true</visible><br />
</item><br />
<item library="contextitem2.py"><br />
<label>30002</label><br />
<visible>true</visible><br />
</item><br />
<menu><br />
<label>Subsubmenu</label><br />
<item library="contextitem3.py"><br />
<label>30003</label><br />
<visible>true</visible><br />
</item><br />
</menu><br />
</menu><br />
</syntaxhighlight><br />
<br />
<br />
= Accessing information about selected item =<br />
<br />
The <code>sys.listitem</code> attribute contains a copy of the item the context menu was opened on. It is an instance of <code>xbmcgui.ListItem</code>. See https://codedocs.xyz/xbmc/xbmc/group__python__xbmcgui__listitem.html for available properties.<br />
<br />
Example script:<br />
<br />
<syntaxhighlight lang="python"><br />
import sys<br />
import xbmc<br />
<br />
if __name__ == '__main__':<br />
message = "Clicked on '{}'".format(sys.listitem.getLabel())<br />
xbmcgui.Dialog().notification("Hello context items!", message)<br />
</syntaxhighlight><br />
<br />
= v15 Isengard (deprecated) =<br />
Isengard, API version 2.20.0, does not support <menu> definition and can only define a single item as follows:<br />
<syntaxhighlight lang="xml"><br />
<extension point="kodi.context.item" library="addon.py"><br />
<item><br />
<label>Hello World</label><br />
<visible>!IsEmpty(ListItem.Genre)</visible><br />
<parent>kodi.core.manage</parent><br />
</item><br />
</extension><br />
</syntaxhighlight><br />
<br />
This syntax is considered deprecated and will be removed in future versions.<br />
<br />
Note: Both syntaxes are '''backwards''' and '''forward''' compatible. Add-ons may use both the old <item> and the new <menu> at the same time for comparability with v15 Isengard and v16 Jarvis.<br />
<br />
[[Category:Add-on development]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=Context_Item_Add-ons&diff=235218Context Item Add-ons2021-10-03T19:33:53Z<p>SistemaRayoXP: Fixed headers</p>
<hr />
<div>Context item add-ons extend the Kodi [[context menu]] with useful actions not present in Kodi by default.<br />
<br />
= Introduction =<br />
<br />
Context item add-ons must provide the <code>kodi.context.item</code> extension point and a <menu> definition. <br />
<br />
Example:<br />
<br />
<syntaxhighlight lang="xml"><br />
<extension point="kodi.context.item"><br />
<menu id="kodi.core.main"><br />
<item library="contextitem.py"><br />
<label>30000</label><br />
<visible>true</visible><br />
</item><br />
</menu><br />
</extension><br />
</syntaxhighlight><br />
<br />
The first '''<menu>''' element defines which top level menu to attach to. In core, there are two available: <code>kodi.core.main</code> and <code>kodi.core.manage</code>. Add-ons may attach to a menu defined by other add-ons as well.<br />
<br />
Next, the '''<item>''' element defines the action to add to perform when the user selects the item. It is specified my assigning the name of a Python script file to the <code>library</code> attribute. Each menu item needs to have a unique <code>library</code> value (Duplicate items are ignored).<br />
<br />
'''<label>''' is a string, or an ID from the language file, that specifies the text that is shown in the context menu item, on the screen.<br />
<br />
'''<visible>''' is required, and should contain a [[Conditional visibility|visibility expression]], which will determine if (or when) the item is visible in the [[context menu]]. <br />
<br />
This feature requires at least version 2.23.0 of the Python API (Jarvis), which should be specified in the [[Addon.xml#<requires>]] element:<br />
<syntaxhighlight lang="xml"><br />
<import addon="xbmc.python" version="2.23.0"/><br />
</syntaxhighlight><br />
<br />
{{note|Kodi v19 Matrix and later.}}<br />
<br />
In Kodi v19 Matrix and later, it is possible to specify an optional <code>args</code> attribute to a context item. The contents of this attribute will be passed as an argument to the script specified in the <code>library</code> attribute. It can be accessed via <code>sys.argv</code>. The combination of <code>args</code> and <code>library</code> need to be unique. Duplicate combinations are ignored.<br />
<br />
<syntaxhighlight lang="xml"><br />
<extension point="kodi.context.item"><br />
<menu id="kodi.core.main"><br />
<item library="contextitem.py" args="command_arg"><br />
<label>30000</label><br />
<visible>true</visible><br />
</item><br />
</menu><br />
</extension><br />
</syntaxhighlight><br />
<br />
{{Note|Keep in mind that there is limited space in the [[context menu]]. Attaching a context menu to an add-on will force the user to have all of them enabled at the same time. Consider using [[#Submenus]], or creating a separate add-on.}}<br />
<br />
<br />
= Submenus =<br />
<br />
<menu> and <item> elements may be mixed and nested to created submenus. Example:<br />
<br />
<syntaxhighlight lang="xml"><br />
<menu id="kodi.core.main"><br />
<menu><br />
<label>My submenu</label><br />
<item library="contextitem1.py"><br />
<label>30001</label><br />
<visible>true</visible><br />
</item><br />
<item library="contextitem2.py"><br />
<label>30002</label><br />
<visible>true</visible><br />
</item><br />
<menu><br />
<label>Subsubmenu</label><br />
<item library="contextitem3.py"><br />
<label>30003</label><br />
<visible>true</visible><br />
</item><br />
</menu><br />
</menu><br />
</syntaxhighlight><br />
<br />
<br />
= Accessing information about selected item =<br />
<br />
The <code>sys.listitem</code> attribute contains a copy of the item the context menu was opened on. It is an instance of <code>xbmcgui.ListItem</code>. See https://codedocs.xyz/xbmc/xbmc/group__python__xbmcgui__listitem.html for available properties.<br />
<br />
Example script:<br />
<br />
<syntaxhighlight lang="python"><br />
import sys<br />
import xbmc<br />
<br />
if __name__ == '__main__':<br />
message = "Clicked on '{}'".format(sys.listitem.getLabel())<br />
xbmcgui.Dialog().notification("Hello context items!", message)<br />
</syntaxhighlight><br />
<br />
= v15 Isengard (deprecated) =<br />
Isengard, API version 2.20.0, does not support <menu> definition and can only define a single item as follows:<br />
<syntaxhighlight lang="xml"><br />
<extension point="kodi.context.item" library="addon.py"><br />
<item><br />
<label>Hello World</label><br />
<visible>!IsEmpty(ListItem.Genre)</visible><br />
<parent>kodi.core.manage</parent><br />
</item><br />
</extension><br />
</syntaxhighlight><br />
<br />
This syntax is considered deprecated and will be removed in future versions.<br />
<br />
Note: Both syntaxes are '''backwards''' and '''forward''' compatible. Add-ons may use both the old <item> and the new <menu> at the same time for comparability with v15 Isengard and v16 Jarvis.<br />
<br />
[[Category:Add-on development]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=User:SistemaRayoXP/Playground&diff=235013User:SistemaRayoXP/Playground2021-09-27T23:05:46Z<p>SistemaRayoXP: Added some details about subtitle handling, missing some others</p>
<hr />
<div>So, you want to create a subtitle script, right? Or why else would you be here?<br />
<br />
To get started, you need some programming skills (Python, specifically), but with determination, you can get it done, and even learn a thing or two!<br />
<br />
= Structure =<br />
== What Kodi requires for your add-on ==<br />
For XBMC to know what to do with your addon, we require your script, and an addon.xml file. See [[Add-on_development|here]] for more information on addon.xml, including how you add descriptions to your addon for users. A subtitle plugin source extends XBMC via the xbmc.python.subtitles extension point. The layout of the XML describing this extension point is as follows:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<extension point="xbmc.python.subtitles"<br />
library="default.py" /><br />
</syntaxhighlight><br />
<br />
list of extension points and their explanation:<br />
<br />
"xbmc.python.script" This is the standard Script extension point<br />
<br />
below listed extensions will not appear in the Scripts/Programs window and can only be run via skin shortcuts<br />
<br />
"xbmc.python.weather" Used for weather scripts<br />
"xbmc.python.subtitles" Used for subtitle scripts<br />
"xbmc.python.lyrics" Used for lyrics scripts<br />
"xbmc.python.library" Used for skin dependent scripts (e.g. recently added script)<br />
<br />
<br />
Example of "xbmc.python.subtitles":<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="script.xbmc.subtitles"<br />
name="XBMC Subtitles"<br />
version="1.7.4"<br />
provider-name="Amet"><br />
<requires><br />
<import addon="xbmc.python" version="1.0"/><br />
</requires><br />
<extension point="xbmc.python.subtitles"<br />
library="default.py" /><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">Kodi Subtitles</summary><br />
<summary lang="hu">Kodi feliratok</summary> <br />
<description lang="en">Search and download subtitles from OpenSubtitles.org, Podnapisi.net, Sublight.si and Bierdopje.com. Subtitle button on OSD needs to be activated and path set to Kodi Subtitles under System-> Skin-> Addon Scripts</description><br />
<description lang="hu">Film feliratok keresése letöltése az OpenSubtitles.org, Podnapisi.net, Sublight.si and Bierdopje.com webhelyekról. A dalszöveg OSD gombot aktiválni kell az elérési út megadásával a Beállítások -> Skin -> Szkriptek alatt.</description><br />
<description lang="sr">Претражи и скини преводе са OpenSubtitles.org, Podnapisi.net, Sublight.si и Bierdopje.com. Дугме за преводе на OSD треба да се активира и изабере Kodi Subtitles у Систем-> Маска-> Скрипт додаци</description><br />
<platform>all</platform><br />
</extension><br />
</addon><br />
<br />
</syntaxhighlight><br />
<br />
See [[Add-on structure]] if you want more details on ways to structure your add-on.<br />
<br />
= Interacting with XBMC =<br />
When Kodi calls a subtitle script, it passes several parameters and arguments about the kind of subtitle the user is looking for, like the search terms and the language for the subtitles.<br />
<br />
These parameters and arguments are passed in the '''sys.argv[2]''' Python variable. They are urlencoded, so you might want to import the urllib module (urllib3 in [[Matrix]]) and user the urlparse module to parse the parameters.<br />
<br />
Given that your script can return information to the user, you may wish to allow some (or all) of the information you provide to be translatable. You do this by providing a strings.xml file (in resources/language/<name_of_language>/strings.xml) which associates integer id's with each label. Kodi then handles loading these string files and ensuring that the users' locale information is taken into account. To display strings you use the '''getString''' function in the xbmcaddon module.<br />
<br />
[[Category:Add-on development]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=User:SistemaRayoXP/Playground&diff=234126User:SistemaRayoXP/Playground2021-09-21T05:25:20Z<p>SistemaRayoXP: Updated</p>
<hr />
<div>So, you want to create a subtitle script, right? Or why else would you be here?<br />
<br />
To get started, you need some programming skills (Python, specifically), but with determination, you can get it done, and even get a new skill!<br />
<br />
= Structure =<br />
See [[Add-on_structure]] for more information<br />
== What Kodi requires for your add-on ==<br />
For XBMC to know what to do with your addon, we require your script, and an addon.xml file. See [[Add-on_development|here]] for more information on addon.xml, including how you add descriptions to your addon for users. A subtitle plugin source extends XBMC via the xbmc.python.subtitles extension point. The layout of the XML describing this extension point is as follows:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<extension point="xbmc.python.subtitles"<br />
library="default.py" /><br />
</syntaxhighlight><br />
<br />
list of extension points and their explanation:<br />
<br />
"xbmc.python.script" This is the standard Script extension point<br />
<br />
below listed extensions will not appear in the Scripts/Programs window and can only be run via skin shortcuts<br />
<br />
"xbmc.python.weather" Used for weather scripts<br />
"xbmc.python.subtitles" Used for subtitle scripts<br />
"xbmc.python.lyrics" Used for lyrics scripts<br />
"xbmc.python.library" Used for skin dependent scripts (e.g. recently added script)<br />
<br />
<br />
Example of "xbmc.python.subtitles":<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="script.xbmc.subtitles"<br />
name="XBMC Subtitles"<br />
version="1.7.4"<br />
provider-name="Amet"><br />
<requires><br />
<import addon="xbmc.python" version="1.0"/><br />
</requires><br />
<extension point="xbmc.python.subtitles"<br />
library="default.py" /><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">XBMC Subtitles</summary><br />
<summary lang="hu">XBMC feliratok</summary> <br />
<description lang="en">Search and download subtitles from OpenSubtitles.org, Podnapisi.net, Sublight.si and Bierdopje.com. Subtitle button on OSD needs to be activated and path set to Kodi Subtitles under System-> Skin-> Addon Scripts</description><br />
<description lang="hu">Film feliratok keresése letöltése az OpenSubtitles.org, Podnapisi.net, Sublight.si and Bierdopje.com webhelyekról. A dalszöveg OSD gombot aktiválni kell az elérési út megadásával a Beállítások -> Skin -> Szkriptek alatt.</description><br />
<description lang="sr">Претражи и скини преводе са OpenSubtitles.org, Podnapisi.net, Sublight.si и Bierdopje.com. Дугме за преводе на OSD треба да се активира и изабере Kodi Subtitles у Систем-> Маска-> Скрипт додаци</description><br />
<platform>all</platform><br />
</extension><br />
</addon><br />
<br />
</syntaxhighlight><br />
<br />
= Interacting with XBMC =<br />
Given that your script can return information to the user, you may wish to allow some (or all) of the information you provide to be translatable. You do this by providing a strings.xml file (in resources/language/<name_of_language>/strings.xml) which associates integer id's with each label. XBMC then handles loading these string files and ensuring that the users' locale information is taken into account. To display strings you use the '''getString''' function in the xbmcaddon module.<br />
<br />
[[Category:Add-on development]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=Special_protocol&diff=234124Special protocol2021-09-19T21:20:08Z<p>SistemaRayoXP: Added "portable_data" to userdata portable path</p>
<hr />
<div>{{mininav|[[Development]]}}<br />
<section begin="intro" />The "Special Protocol" is Kodi's solution to platform dependent directories. Common directory names are assigned a special://[name] path which is passed around inside Kodi and then translated to the platform specific path before the operating system sees it. This helps keep most of the platform mess centralized in the code.<section end="intro" /><br />
<br />
<br />
== Available Paths ==<br />
{| class="prettytable"<br />
|-<br />
! Path<br />
! Description<br />
|-<br />
| <code>'''special://xbmc'''</code><br />
| Kodi's installation root directory. This path is read-only contains the Kodi binary, support libraries and default configuration files, skins, scripts and plugins. Users should not modify files or install addons in this directory.<br />
:: {{Note|The special://xbmc/ path is still valid for newer versions that have been renamed to Kodi. <br /><br />special://kodi/ does '''not''' exist yet.}}<br />
|-<br />
| <code>'''special://home'''</code><br />
| Kodi's user specific (OS user) configuration directory. This path contains a writable version of the special://xbmc directories. Any addons should be installed here.<br />
|-<br />
| <code>'''special://temp'''</code><br />
| Kodi's temporary directory. This path is used to cache various data during normal usage. Unless you need the log, nothing in this directory is detrimental to Kodi's operation. Normally special://home/temp<br />
|-<br />
| <code>'''special://masterprofile'''</code><br />
| Kodi's main configuration directory. Normally located at special://home/userdata, this directory contains global settings and sources, as well as any Kodi profile directories. Normally special://home/userdata<br />
|-<br />
| <code>'''special://profile'''</code><br />
| Kodi's currently active profile directory. This directory points at special://masterprofile/''profile_name'' (or special://masterprofile if no profile is in use) and contains per profile overrides for settings and sources.<br />
|-<br />
| <code>'''special://subtitles'''</code><br />
| User defined custom subtitle path. Set it in Video Settings.<br />
|-<br />
| <code>'''special://userdata'''</code><br />
| Alias from special://masterprofile.<br />
|-<br />
| <code>'''special://database'''</code><br />
| This path contains the database files Kodi uses to store library info. Normally special://masterprofile/Database.<br />
|-<br />
| <code>'''special://thumbnails'''</code><br />
| This path contains cached thumbnails. Normally special://masterprofile/Thumbnails<br />
|-<br />
| <code>'''special://recordings'''</code><br />
| This path contains saved [[PVR]] recordings.<br />
|-<br />
| <code>'''special://screenshots'''</code><br />
| This path contains Kodi screen shots. You will be asked to specify this directory the first time you take a screen shot.<br />
|-<br />
| <code>'''special://musicplaylists'''</code><br />
| This path contains saved music playlists. Normally special://profile/playlists/music.<br />
|-<br />
| <code>'''special://videoplaylists'''</code><br />
| This path contains saved video playlists. Normally special://profile/playlists/video.<br />
|-<br />
| <code>'''special://cdrips'''</code><br />
| This path contains the tracks from CDs you rip with Kodi. You will be asked to specify this directory the first time you rip a CD.<br />
|-<br />
| <code>'''special://skin'''</code><br />
| This path points to the currently active skin's root directory.<br />
|-<br />
| <code>'''special://logpath'''</code><br />
| This path points to the path where the [[log file]] is saved.<br />
|-<br />
| <code>'''library://video/'''</code><br />
| This path points to the Video Library folders and to the file Sources<br />
|-<br />
| <code>'''library://music/'''</code><br />
| This path points to the Music Library folders and to the file Sources<br />
|}<br />
<br />
<br />
<br />
== Default OS mappings ==<br />
* Bulleted list item<br />
<br />
=== Android ===<br />
* '''special://xbmc''' - /data/data/org.xbmc.kodi/cache/apk/assets/<br />
* '''special://home''' - /sdcard/Android/data/org.xbmc.kodi/files/.kodi/<br />
* '''special://temp''' - /sdcard/Android/data/org.xbmc.kodi/files/.kodi/temp/<br />
<br />
=== iOS ===<br />
;Apple TV 2 (black)<br />
* '''special://xbmc''' - /private/var/stash/Applications/Kodi.frappliance/KodiData/KodiHome<br />
* '''special://home''' - /private/var/mobile/Library/Preferences/Kodi<br />
* '''special://temp''' - /private/var/mobile/Library/Preferences/Kodi/temp<br />
<br />
;iDevice<br />
* '''special://xbmc''' - /Applications/Kodi.app/KodiData/KodiHome {{highlight|''<- Symbolic link, but the real path has some random characters in it.''}}<br />
* '''special://home''' - /private/var/mobile/Library/Preferences/Kodi<br />
* '''special://temp''' - private/var/mobile/Library/Preferences/Kodi/temp<br />
<br />
=== Linux ===<br />
* '''special://xbmc''' - /usr/share/kodi when installed from a binary package (ie PPA, rpm, deb, etc). /usr/local/share/kodi when compiled (unless you specify an alternate prefix)<br />
* '''special://home''' - /home/''[username]''/.kodi <br />
:: {{Note|The '.', this directory is hidden so you may need to enable hidden files in your file manager to see it.}}<br />
<br />
=== Mac OS X ===<br />
* '''special://xbmc''' - /Applications/Kodi.app/Contents/Resources/Kodi<br />
* '''special://home''' - /Users/''[username]''/Library/Application Support/Kodi<br />
* '''special://temp''' - /Users/''[username]''/.kodi/temp <br />
:: {{Note|The '.', this directory is hidden so you need to enable hidden files to see it.<br />
<br />
=== Windows ===<br />
This assumes your Windows install drive is C:. Replace as necessary.<br />
* '''special://xbmc''' - C:\Program Files\Kodi<br />
* '''special://xbmc''' - C:\Program Files (x86)\Kodi (Windows 64 bit)<br />
* '''special://home''' - C:\Users\''[username]''\AppData\Roaming\Kodi<br />
<br />
;Portable Mode<br />
In portable mode, Kodi is entirely self contained, so its install directory must be writable.<br />
* '''special://xbmc''' - Where ever you installed Kodi (MUST be writable).<br />
* '''special://home''' - special://xbmc/portable_data<br />
<br />
<br />
<br />
== See also ==<br />
* [[Userdata]]<br />
* [[Development]]<br />
* [[Opening_Windows_and_Dialogs]]<br />
<br />
<br />
{{Helix updated}}<br />
<br />
[[Category:Add-on development]]<br />
[[Category:Skin development]]<br />
[[Category:Development]]<br />
[[Category:Advanced topics]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=User:SistemaRayoXP/Playground&diff=234123User:SistemaRayoXP/Playground2021-09-19T21:15:34Z<p>SistemaRayoXP: Initial creation of SistemaRayoXP/playground, being planned on</p>
<hr />
<div>==What Kodi requires for your add-on==<br />
For XBMC to know what to do with your addon, we require your script, and an addon.xml file. See [[Add-on_development|here]] for more information on addon.xml, including how you add descriptions to your addon for users. A plugin source extends XBMC via the xbmc.python.subtitles extension point. The layout of the XML describing this extension point is as follows:<br />
<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<extension point="xbmc.python.subtitles"<br />
library="default.py" /><br />
</syntaxhighlight><br />
<br />
list of extension points and their explanation:<br />
<br />
"xbmc.python.script" This is the standard Script extension point<br />
<br />
below listed extensions will not appear in the Scripts/Programs window and can only be run via skin shortcuts<br />
<br />
"xbmc.python.weather" Used for weather scripts<br />
"xbmc.python.subtitles" Used for subtitle scripts<br />
"xbmc.python.lyrics" Used for lyrics scripts<br />
"xbmc.python.library" Used for skin dependent scripts (e.g. recently added script)<br />
<br />
<br />
Example of "xbmc.python.subtitles":<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<addon id="script.xbmc.subtitles"<br />
name="XBMC Subtitles"<br />
version="1.7.4"<br />
provider-name="Amet"><br />
<requires><br />
<import addon="xbmc.python" version="1.0"/><br />
</requires><br />
<extension point="xbmc.python.subtitles"<br />
library="default.py" /><br />
<extension point="xbmc.addon.metadata"><br />
<summary lang="en">XBMC Subtitles</summary><br />
<summary lang="hu">XBMC feliratok</summary> <br />
<description lang="en">Search and download subtitles from OpenSubtitles.org, Podnapisi.net, Sublight.si and Bierdopje.com. Subtitle button on OSD needs to be activated and path set to Kodi Subtitles under System-> Skin-> Addon Scripts</description><br />
<description lang="hu">Film feliratok keresése letöltése az OpenSubtitles.org, Podnapisi.net, Sublight.si and Bierdopje.com webhelyekról. A dalszöveg OSD gombot aktiválni kell az elérési út megadásával a Beállítások -> Skin -> Szkriptek alatt.</description><br />
<description lang="sr">Претражи и скини преводе са OpenSubtitles.org, Podnapisi.net, Sublight.si и Bierdopje.com. Дугме за преводе на OSD треба да се активира и изабере Kodi Subtitles у Систем-> Маска-> Скрипт додаци</description><br />
<platform>all</platform><br />
</extension><br />
</addon><br />
<br />
</syntaxhighlight><br />
<br />
== Interacting with XBMC ==<br />
Given that your script can return information to the user, you may wish to allow some (or all) of the information you provide to be translatable. You do this by providing a strings.xml file (in resources/language/<name_of_language>/strings.xml) which associates integer id's with each label. XBMC then handles loading these string files and ensuring that the users' locale information is taken into account. To display strings you use the '''getString''' function in the xbmcaddon module.<br />
<br />
[[Category:Add-on development]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=User:SistemaRayoXP&diff=234122User:SistemaRayoXP2021-09-19T21:11:42Z<p>SistemaRayoXP: User page creation</p>
<hr />
<div>Hello everyone! 👋 I'm SistemaRayoXP, a Mexican Kodi user 😁. I really like mass-translating 💬, though I only do it every so often 😅. I also enjoy documenting stuff 🧐, it makes life easier for everyone 🙌, including myself 😜<br />
<br />
[[User:SistemaRayoXP/Playground|SistemaRayoXP / Playground]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=Scrapers&diff=233309Scrapers2021-09-15T14:12:43Z<p>SistemaRayoXP: Added syntax highlight</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
{{see also|Video library|Music library}}<br />
{{cleanup}}<br />
<section begin="intro" />Scrapers (also outside the Kodi community more commonly referred to as "''[http://en.wikipedia.org/wiki/Web_scraper web scrapers]''" or "''[http://en.wikipedia.org/wiki/Importer_(computing) importers]''") are used by Kodi to go online to automatically retrieve [http://en.wikipedia.org/wiki/Metadata metadata] information and [[artwork]] from websites for Music, Videos, Movies and TV Shows. This meta data information and artwork is then used for Kodi's music and video [[Library|libraries]].<section end="intro" /><br /><br />
<br />
= Introduction to Scrapers =<br />
Before version 2.0 of Kodi Media Center the only available web scraper we had was a IMDb importer. In later versions it has become possible to create custom scrapers to collect data from almost any web-page which list information in a consistent way, and today Kodi comes with many scrapers for several languages and different websites.<br />
<br />
To learn more about actually using scrapers in Kodi, please look at:<br />
* [[Adding_video_sources]]<br />
And to learn more about '''creating''' scrapers, please look at this article:<br />
* [[HOW-TO:Write_media_scrapers|HOW-TO Write Media Info Scrapers]]<br />
<br />
Kodi come with several scrapers for Movies, TV shows and Music Videos which are stored in xbmc\system\scrapers\video. They are just specially formatted [http://en.wikipedia.org/wiki/XML XML] files.<br />
* The location of the scrapers has changed for EDEN Beta 3 - the \scrapers directory is old. They are now add-ons- see the 'the movieDB' as an example- just copy the directories metadata.themoviedb.org and metadata.common.themoviedb.org to your own names, change a few xml guts and you will have a new scraper that you can play with. THEN these instructions become relevant again.<br />
<br />
The scraper XML file consists of text processing operations that work over a set of text buffers, labelled $$1 to $$20. The basic operation is RegExp. A single RegExp is a text processing command that takes text in buffer 'input', runs <expression> on it... formats the matches with 'output' and places (or appends) the result in buffer 'dest'. A scraper XML file must use RegExps to implement functions that Kodi will call such as GetSearchResults.<br />
<br />
== Prerequisites ==<br />
* Knowledge of [[RegEx_tutorial|regular expressions]]<br />
* Basic [http://en.wikipedia.org/wiki/XML XML] syntax knowledge.<br />
<br />
== Layout ==<br />
To see a full scraper, see the [https://github.com/xbmc/repo-scrapers/tree/gotham/metadata.themoviedb.org themoviedb reference implementation] in GIT.<br />
The general layout of scraper.xml is as follows:<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<scraper><br />
<NfoUrl><br />
<RegExp><br />
<expression></expression><br />
</RegExp><br />
</NfoUrl><br />
<CreateSearchUrl><br />
<RegExp><br />
<expression></expression><br />
</RegExp><br />
</CreateSearchUrl><br />
<GetSearchResults><br />
<RegExp><br />
<expression></expression><br />
</RegExp><br />
</GetSearchResults><br />
<GetDetails><br />
<RegExp><br />
<expression></expression><br />
</RegExp><br />
</GetDetails><br />
<CustomFunction><br />
<RegExp><br />
<expression></expression><br />
</RegExp><br />
</CustomFunction><br />
</scraper><br />
</syntaxhighlight><br />
<br />
If RegExp tags are being nested they are being worked through in a [http://en.wikipedia.org/wiki/Lifo lifo] manner.<br />
<br />
== Kodi/Scraper Interaction ==<br />
[[File:Scraperinterface.png]]<br />
<br />
== XML character entity references ==<br />
Unlike traditional HTML with its large range of character entity references, in XML there are only five predefined character entity references. These are used to escape characters that are markup sensitive in certain contexts:<br />
<br />
* &amp;amp; → & <br />
* &amp;lt; → < <br />
* &amp;gt; → > <br />
* &amp;quot; → " <br />
* &amp;apos; → ' <br />
<br />
This means that in the regular expressions you actually have to use entities instead of the actual characters.<br />
<br />
For example, the following would be wrong:<br />
<source lang="xml"><br />
<CreateSearchUrl dest="3"><br />
<RegExp input="$$1" output="http://www.example.com/search.php?title=\1&new=true" dest="3"><br />
<expression noclean="1"> <a href="example">.[^<]* </expression><br />
</RegExp><br />
</CreateSearchUrl><br />
</source><br />
Use instead:<br />
<source lang="xml"><br />
<CreateSearchUrl dest="3"><br />
<RegExp input="$$1" output="http://www.example.com/search.php?title=\1&amp;amp;new=true" dest="3"><br />
<expression noclean="1"> &amp;lt;a href=&amp;quot;example&amp;quot;&amp;gt;.[^&amp;lt;]* </expression><br />
</RegExp><br />
</CreateSearchUrl><br />
</source><br />
If you open the scraper XML file in a web browser the actual characters are shown for the entities, be careful if you cut&paste.<br />
<br />
== Regular Expression Engine ==<br />
There are a few things to note about the regular expression engine:<br />
* Laziness doesn't work. e.g. <xml>.*?</xml> (For a workaround see http://www.regular-expressions.info/repeat.html An Alternative to Laziness)<br />
* \w or \d does not work, use [a-zA-Z] and [0-9] instead<br />
* Regular expressions are case sensitive<br />
* A dot matches a new line<br />
* Beginning of line ^ and end of line $ does not seem to work<br />
<br />
== Tags in Detail ==<br />
<br />
=== <scraper> ===<br />
<br />
<scraper name="jaded video" content="movies" thumb="jaded.jpg" framework="1.0" date="2009-05-22"></scraper><br />
<br />
The sole purpose of this tag is to define the name, type and thumbnail of scraper.<br />
<br />
* name: The name of the scraper<br />
* content: movies/tvshows/mvid<br />
* thumb: relative path to a scraper thumbnail<br />
* framework: Scraper Framework being used. The latest is 1.0 (as used in Kodi 9.04 Babylon)<br />
* date: Date this version of the scraper has been released in [http://en.wikipedia.org/wiki/ISO_8601 ISO 8601]<br />
<br />
=== <url></url> ===<br />
This is an output string that the scraper.xml generates and passes to Kodi. Url tags can have the following attributes:<br /><br />
* spoof: The referrer url which should be send. This is sometimes needed for pages with direct linking protection.<br />
* post: if the post attribute is present variables in the url will be send via POST.<br />
* function: See GetDetails.<br />
Example:<br />
<url spoof="http://www.google.com">http://akas.imdb.com/find?s=tt;q=\1</url><br />
Every url returned from the scrapers has to be inside an url tag. An exception is CreateSearchUrl where the url tag is optional.<br />
<br />
=== <RegExp><expression></RegExp> ===<br />
A RegExp is a text processing command that takes text in buffer 'input', runs <expression> on it... formats the matches with 'output' and places the result in buffer 'dest'<br />
<source lang="xml"><br />
<RegExp conditional="override" input="$$5" output="&lt;details&gt;\1&lt;/details&gt;" dest="3"><br />
<expression repeat="yes" noclean="1" trim="1" clear="no">([a-zA-Z][^,]*)</expression><br />
</RegExp><br />
</source><br />
==== <expression> ====<br />
The <expression> tag holds the regular expression. Here it is: <xml>([a-zA-Z][^,]*)whatever (.[^-]*)</xml><br />
The regular expression matches are stored in \1, \2, ... , \9 and can be used in the output attribute of the RegExp tag. If the expression is blank, the input buffer contents is put into match \1.<br />
<br />
* repeat="yes/no": Repeat the regular expression.<br />
* noclean="1,..,9": By default html tags and special characters are stripped from the matches \1, ..., \9. By setting noclean="1, ..., 9" you can stop this behavior.<br />
* trim="1,..,9": Trim white spaces from the end of matches 1 to 9.<br />
* clear=yes/no": If set to yes, if the expression fails dest is cleared<br />
<br />
==== <RegExp> ====<br />
The RegExp tag sets the input which will is being searched by the regular expression<br />
<br />
* input="$$x" where x=1 to 9: The input variable holds the text that will get searched by the regular expression<br />
* output: Defines how the output should look like. Here you can use \1, ..., \9 which represent regular expression matches.<br />
* dest="x" where x=1 to 9: The variable to which the output should be stored to. If clear is true, its previous content will get cleared if the expression fails.<br />
* conditonal="<condition>": A condition that must resolve to TRUE for the particular RegExp to be run. Currently the only available condition is "override", which is set based on the Language Override setting in the scraper.<br />
<br />
=== <NfoUrl> ===<br />
It's the task of NfoUrl to return the url for GetDetails from an nfo.<br /><br />
'''Inputs''':<br /><br />
* $$1: Variable 1 holds the content of the Nfo file.<br />
<br />
=== <CreateSearchUrl> ===<br />
<source lang="xml"><br />
<CreateSearchUrl dest="3"><br />
<RegExp input="$$1" output="http://akas.imdb.com/find?s=tt;q=\1" dest="3"><br />
<expression noclean="1"></expression><br />
</RegExp><br />
</CreateSearchUrl><br />
</source><br />
'''Inputs''':<br /><br />
* $$1: Variable 1 holds the search string. This is usually the filename stripped by some words e.g. DVDRip, Xvid ..<br />
<br />
The purpose of this function is to create a variable which will hold the url of the search result page.<br />
* dest="x" where x=1 to 9: Variable x shall hold the url of the search result page.<br />
<br />
In the example above <CreateSearchUrl dest="3"> means that variable 3 should hold the search results page url.<br />
The Regular expression tag searches through variable 1 and stores the searchstring in variable 3. Since no expression is specified the entire variable $$1 is matched and stored in \1. Since this does not contain html tags it is not necessary to clean \1.<br />
<br />
=== <GetSearchResults> ===<br />
<source lang="xml"><br />
<GetSearchResults dest="8"><br />
<RegExp input="$$5" output="&lt;?xml version="1.0" encoding="iso-8859-1" standalone="yes"?&gt;&lt;results&gt;\1&lt;/results&gt;" dest="8"><br />
<RegExp input="$$1" output="&lt;entity&gt;&lt;title&gt;\1&lt;/title&gt;&lt;url&gt;http://jadedvideo.com/yz_resultJAVA.asp?PRODUCT_ID=\2&lt;/url&gt;&lt;/entity&gt;" dest="5"><br />
<expression repeat="yes">&lt;font color="#000FF"&gt;(.[^"]*)&lt;/big&gt;.[^"]*SKU: ([0-9]+)&lt;br&gt;</expression><br />
</RegExp><br />
<expression noclean="1"></expression><br />
</RegExp><br />
</GetSearchResults><br />
</source><br />
'''Inputs''':<br /><br />
* $$1: Variable 1 hold the content of the search URL returned to CreateSearchUrl.<br />
<br />
It is the task of this function to return a list of search results in the following format:<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><br />
<results><br />
<entity><br />
<title></title><br />
<url></url><br />
<url></url><br />
</entity><br />
<entity><br />
<title></title><br />
<url></url><br />
<url></url><br />
</entity><br />
</results><br />
</syntaxhighlight><br />
There can be up to 9 <url> tags within each movie tag. The webpages specified in the url tags should hold detailed information about the movie/tv series/mvid. In most cases one url will be enough. The url tag can have the argument function="nameoffunction" e.g.<br />
<source lang="xml"><xml><url function="CustomFunction">theurl</url></xml></source><br />
In this case other then GetDetails, "CustomFunction" will be executed after GetDetails has run. <br />
<br />
When using the scraper the user will be asked in Kodi to select one of the movies from the list which was returned by this function. The one which gets selected will be processed from there on.<br />
<br />
By default Kodi will try to intelligently re-order the list of returned entries by comparing titles with the search string. If the results you are returning are already in a properly sorted order set <results sorted="yes">.<br />
<br />
=== <GetDetails> ===<br />
Here the actual data which is being saved in the database is being retrieved. For movies the following format should be returned:<br />
<source lang="xml"><br />
<details><br />
<title></title><br />
<year></year><br />
<director></director><br />
<top250></top250><br />
<mpaa></mpaa><br />
<tagline></tagline><br />
<runtime></runtime><br />
<thumb></thumb><br />
<credits></credits><br />
<rating></rating><br />
<votes></votes><br />
<genre></genre><br />
<actor><br />
<name></name><br />
<role></role><br />
</actor><br />
<outline></outline><br />
<plot></plot><br />
</details><br />
</source><br />
'''Inputs:'''<br /><br />
* $$x where x= 1 to 9: Variable x holds the content of the URL specified in the <url> tag number x in GetSearchResults.<br />
e.g. if there are two <url> tags (without argument function) returned by GetSearchResults. Variable 1 will contain the content of the first url tag and variable 2 the content of the second url tag.<br />
<br />
'''<thumb>:'''<br /><br />
The thumb tag can have a spoof argument (like <url>). This feature can be used to circumvent direct linking protections. <br />
The firefox extensions refspoof http://refspoof.mozdev.org/ can help in testing if referrer spoofing works.<br />
<br />
'''Multiple tags:'''<br /><br />
* The following tags can appear more than once in <details>:<br />
** genre<br />
** credits <br />
** director<br />
** actor<br />
<br />
=== <CustomFunction> ===<br />
This function should return an xml similar to GetDetails. For tags that can have multiple values the values of CustomFunction and GetDetails are combined (genre etc). For the rest the last CustomFunction will take precedence.<br />
<br />
'''Inputs:''' <br />
* $$1: Variable 1 holds the content of the URL specified in the url tag with the function="CustomFunction" argument.<br />
e.g. for<br />
<source lang="xml"><br />
<url function="CustomFunction">http://www.imdb.com/title/tt0452624/</url><br />
</source><br />
variable 1 would hold the content of "http://www.imdb.com/title/tt0452624/".<br />
<br />
<br />
[[Category:Development]]<br />
[[Category:Scraper]]<br />
[[Category:Video library]]<br />
[[Category:Music library]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=UI_sounds_add-ons&diff=232836UI sounds add-ons2021-08-14T07:43:29Z<p>SistemaRayoXP: Initial creation of this page. Please accommodate as required</p>
<hr />
<div>{{mininav|[[Development]]|[[Add-on development]]}}<br />
{{mininav|[[Skinning]]}}<br />
<br />
You can add, change or modify sounds for Kodi by creating a UI sounds resource add-on. Anyone can create one, only some basic XML understanding is necessary (no programming skills required).<br />
<br />
You can create as many UI sound packs as you feel like, and change between them anytime from the settings.<br />
<br />
An example of a sounds addon can be found here: https://github.com/xbmc/xbmc/tree/master/addons/resource.uisounds.kodi<br />
<br />
= What Kodi requires for your add-on =<br />
<br />
== Creating the working folder == <br />
<br />
To get started, you need to create a working folder for your add-on. This is where all the files for your UI sounds add-on will go.<br />
<br />
You can name your add-on whatever you like. However, you might need to modify the name when naming your add-on's folder<br />
<br />
The naming convention is <code>resource.uisounds.<your-addon-name></code>. E.g. <code>resource.uisounds.kodi</code><br />
<br />
When naming the folder, consider the following:<br />
<br />
* Only use lowercase letters and numbers (the name is treated as case sensitive)<br />
* Underscores are not allowed, use dashes instead<br />
* Any other character is not permitted<br />
<br />
{{greenv|Correct|''resource.uisounds.my-cool-sounds}}<br />
{{redv|Incorrect|''resource.uisounds.My_Cool_Sounds''}}<br />
{{greenv|Correct|''resource.uisounds.dumpsterremix''}}<br />
{{redv|Incorrect|''resource.uisounds.Dumpster Remix!''}}<br />
<br />
{{bluev|Example|'''Dumpster Remix! 2.0''' -> resource.uisounds.dumpsterremix2-0}}<br />
<br />
=== Addon.xml ===<br />
<br />
For Kodi to know what to do with your add-on, a file named <code>addon.xml</code> is required. See [[Addon.xml]] for a detailed explanation on this file. However, very little lines are actually necessary for a basic UI sounds add-on.<br />
<br />
The layout for the <code>addon.xml</code> file is as follows:<br />
<br />
Example '''resource.uisounds.dumpsterremix2-0''':<br />
<syntaxhighlight lang="xml" enclose="div"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<addon id="resource.uisounds.dumpsterremix2-0" version="2.0.0" name="Dumpster Remix! 2.0" provider-name="Funky Philip"><br />
<requires><br />
<import addon="kodi.resource" version="1.0.0"/><br />
</requires><br />
<extension point="kodi.resource.uisounds"/><br />
<extension point="kodi.addon.metadata"><br />
<summary lang="en">Dumpsters chilling Kodi</summary><br />
<description lang="en">A cool-sounding remix of dumpster sounds!</description><br />
<platform>all</platform><br />
<assets><br />
<icon>icon.png</icon><br />
</assets><br />
</extension><br />
</addon><br />
</syntaxhighlight><br />
<br />
'''Overview''':<br />
<br />
* Addon<br />
** id: Name of your working folder <br /> E.g. '''''resource.uisounds.dumpsterremix2-0'''''<br />
** version: The version of your add-on. This should be in the format <var>x.x.x</var> where <var>x</var> is always a number. Increment the version number every time there's a change <br /> E.g, '''''2.0.0'''''<br />
** name: Name of your add-on <br /> E.g, '''''Dumpster Remix! 2.0'''''<br />
** provider-name: Author of the add-on/sounds <br /> E.g. '''''Funky Philip'''''<br />
* Extension "kodi.addon.metadata"<br />
** summary: A short description of the sound pack <br /> E.g. '''''Dumpsters chilling Kodi'''''<br />
*** lang="<lang_code>": See [[Addon.xml]]<br />
** description: An extended description of the sound pack <br /> E.g. '''''A cool-sounding remix of dumpster sounds!'''''<br />
*** lang="<lang_code>": See [[Addon.xml]]<br />
** platform: The platform for which your add-on is targeted. You should always set this to 'all'<br />
** assets<br />
*** icon: The path to the icon of you add-on. <br /> It's highly recommended to always set this to 'icon.png', but you can change this, just make sure that this matches the icon file.<br />
<br />
=== File structure ===<br />
<br />
The file structure should be as follows<br />
<br />
* '''addon.xml''' in the root directory<br />
* '''icon.png''' in the root directory<br />
* '''LICENSE''' (optional) in the root directory<br />
* '''sounds.xml''' in the resources directory<br />
* Sound files ('''*.wav''') in the resources directory<br />
<br />
Example:<br />
addon.xml<br />
icon.png<br />
resources/<br />
back.wav (can be named however you like)<br />
click.wav (can be named however you like)<br />
notify.wav (can be named however you like)<br />
[...]<br />
sounds.xml<br />
<br />
= Creating the sound pack =<br />
<br />
== The sounds.xml file ==<br />
<br />
This file was first introduced in Kodi 15.0 Isengard, as part of the UI sounds add-on. It contains the mapping of actions to sounds, that is, moving left, right, up, down, and opening & closing windows.<br />
<br />
=== <actions> ===<br />
<br />
The <code><actions></code> section contains global mapping, i.e., actions that are not specifically tied to a window, like moving, selecting, getting inside a directory or returning to a parent directory.<br />
<br />
A list of valid actions can be found in [[Action IDs]]<br />
<br />
To map a sound to a specific action, add a block like this to <actions>:<br />
<source lang="xml"><br />
<action><br />
<name>left</name><br />
<file>cursor.wav</file><br />
</action><br />
</source><br />
<br />
Where <code><name></code> specifies the action to map a sound to and <code><file></code> the wav file to play when the action occurs.<br />
<br />
==== '''<actions> example''' ====<br />
<br />
<source lang="xml"><br />
<actions><br />
<action><br />
<name>left</name><br />
<file>glass.wav</file><br />
</action><br />
<action><br />
<name>right</name><br />
<file>glass.wav</file><br />
</action><br />
<action><br />
<name>up</name><br />
<file>steel.wav</file><br />
</action><br />
<action><br />
<name>down</name><br />
<file>steel.wav</file><br />
</action><br />
<action><br />
<name>select</name><br />
<file>dump.wav</file><br />
</action><br />
<action><br />
<name>parentdir</name><br />
<file>garbagetruck.wav</file><br />
</action><br />
<action><br />
<name>previousmenu</name><br />
<file>truckreverse.wav</file><br />
</action><br />
<action><br />
<name>screenshot</name><br />
<file>garbagecompress.wav</file><br />
</action><br />
<action><br />
<name>error</name><br />
<file>truckreverse.wav</file><br />
</action><br />
</actions><br />
</source><br />
<br />
=== <windows> ===<br />
<br />
This refers to window specific sounds, like opening or closing the home menu, games menu, etc.<br />
<br />
To add a new sound, add a block like this to <code><windows></code>:<br />
<br />
<source lang="xml"><br />
<window><br />
<name>infodialog</name><br />
<activate>notify.wav</activate><br />
<deactivate>out.wav</deactivate><br />
</window><br />
</source><br />
<br />
Where <code><name></code> specifies the window to map a sound to, and <code><activate></code> and <code><deactivate></code> are the events a sound can be mapped to (i.e., when the window is showing or hiding).<br />
<br />
Valid entries for <code><name></code> can be found at [[Window IDs]]<br />
<br />
Note: Custom skin files may be used, use window IDs if this is the case<br />
<br />
==== '''<windows> example''' ====<br />
<br />
<source lang="xml"><br />
<windows><br />
<window><br />
<name>notification</name><br />
<activate>garbagecompress.wav</activate><br />
<deactivate>garbagecompressdone.wav</deactivate><br />
</window><br />
<window><br />
<name>home</name><br />
<activate>home.wav</activate><br />
<deactivate>-</deactivate><br />
</window><br />
<window><br />
<name>startup</name><br />
<activate>truckstarts.wav</activate><br />
<deactivate>-</deactivate><br />
</window><br />
</windows><br />
</source><br />
<br />
= Final result =<br />
<br />
If you followed this guide step-by-step, you should have an add-on structure similar to this<br />
<br />
[[File:UI sounds folder structure.png|400px]]<br />
<br />
Now place the folder containing these files in your Kodi addons folder, or pack the folder in a ZIP and install it from within Kodi itself.<br />
<br />
== Submit your add-on! ==<br />
If you feel like, it's encouraged that you [[Submitting Add-ons|submit you addon to the official Kodi repository]], just make sure to follow the guidelines and to not use any copyrighted work without permission.<br />
<br />
Happy sampling!<br />
<br />
[[Category:Skin_development]]<br />
[[Category:Add-on development]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=File:UI_sounds_folder_structure.png&diff=232835File:UI sounds folder structure.png2021-08-14T07:22:20Z<p>SistemaRayoXP: File uploaded with MsUpload</p>
<hr />
<div>File uploaded with MsUpload</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=Skinning&diff=232834Skinning2021-08-13T21:24:30Z<p>SistemaRayoXP: Added planned UI sounds add-ons page</p>
<hr />
<div>{{mininav|[[Development]]}}<br />
<br />
{{Kodi}} is noted as having a very flexible and robust framework for its GUI, making theme-skinning and personal customization very accessible. Users can create their own skin (or modify an existing skin) and share it with others.<br />
<br />
== General ==<br />
{| width="100%"<br />
|- valign="top"<br />
| width="20%" align="center" | {{Main page icon|image=Nuvola apps kthememgr.png|link=Skin development introduction}}<br />
| width="20%" align="center" | {{Main page icon|image=Book icon 1.png|link=Skinning Manual|title=Skinning manual}}<br />
| width="20%" align="center" | {{Main page icon|image=Administration.png|link=Skin development tools}}<br />
| width="20%" align="center" | {{Main page icon|image=Applications-development.png|link=Skinning Engine}}<br />
|}<br />
<br />
== Tutorials ==<br />
{| width="100%"<br />
|- valign="top"<br />
| width="16.666666666666666666666666666667%" align="center" | {{Main page icon|image=Crystal Project window list.png|link=HOW-TO:Add a new window or dialog via skinning|title=Adding a dialog}}<br />
| width="16.666666666666666666666666666667%" align="center" | {{Main page icon|image=Crystal Clear app fonts.png|link=Fonts|title=Adding fonts}}<br />
| width="16.666666666666666666666666666667%" align="center" | {{Main page icon|image=Gnome-preferences-desktop-wallpaper.png|link=HOW-TO:Add_a_new_view_type_to_the_skin|title=Adding a view}}<br />
| width="16.666666666666666666666666666667%" align="center" | {{Main page icon|image=UI_sounds.png|link=UI sounds add-ons|title=Adding sounds}}<br />
| width="16.666666666666666666666666666667%" align="center" | {{Main page icon|image=Estuary-edit-icon2.png|link=HOW-TO:Estuary_Modification|title=Estuary Modifications}}<br />
| width="16.666666666666666666666666666667%" align="center" | {{Main page icon|image=Go-home-2.png|link=HOW-TO:Simple Modifications|title=Simple Modifications}}<br />
|}<br />
<br />
== More information ==<br />
A list of all skin development related pages can be found here... '''[[:Category:Skin_development|List of all Skin Development pages]]'''<br />
<br />
<br />
<br />
<br />
[[Category:Skin_development|*]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=Add-on_development&diff=232833Add-on development2021-08-13T21:10:36Z<p>SistemaRayoXP: Renamed script subtitles to subtitle scripts & added red link to UI sounds add-ons</p>
<hr />
<div>{{mininav|[[Development]]}}<br />
[[File:Wiki logo.png|150px|link=|left]]<br />
<section begin="intro" />This area contains information, tutorials, and links for creating add-ons (and plug-ins) for Kodi.<section end="intro" /><br />
<br />
{{-}}<br />
----<br />
{{huge|'''{{color|black|General}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="16%" align="center" | {{Main page icon|image=Nuvola apps kthememgr.png|link=About Add-ons}}<br />
| width="17%" align="center" | {{Main page icon|image=Administration.png|link=Add-on settings}}<br />
| width="16%" align="center" | {{Main page icon|image=Applications-development.png|link=Add-on structure|title=Add-on Structure}}<br />
| width="17%" align="center" | {{Main page icon|image=Tool-box-icon.png|link=Development Tools}}<br />
| width="16%" align="center" | {{Main page icon|image=60.jpg|link=Special protocol}}<br />
| width="18%" align="center" | {{Main page icon|image=Translate icon.jpg|link=Translations}}<br />
|}<br />
<br />
----<br />
{{huge|'''{{color|black|Add-on Types}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="12.5%" align="center" | {{Main page icon|image=Nuvola apps kthememgr.png|link=Plugin sources}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Misc-Misc-Box-icon.png|link=Add-on_repositories|title=Repository add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Web-icon.png|link=HOW-TO:Write media scrapers|title=Scraper add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Applications-development.png|link=Script sources|title=Scripts}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Administration.png|link=Script subtitles|title=Subtitle scripts}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Gnome-system-run.png|link=Service add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Weather_addon.png|link=Weather addons|title=Weather add-ons}}<br />
| width="12.5%" align="center" | {{Main page icon|image=UI_sounds.png|link=UI sounds add-ons}}<br />
|}<br />
<br />
----<br />
{{huge|'''{{color|black|Tutorials}}'''}}<br />
<br />
{| width="100%"<br />
|- valign="top"<br />
| width="12.5%" align="center" | {{Main page icon|image=music-icon.png|link=HOW-TO:Audio_addon|title=Audio Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=context-menu-icon.png|link=Context_Item_Add-ons|title=Context Item Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Addons-icon.png|link=Audio-video_add-on_tutorial|title=General Add-on Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Translation - Noun project 987.png|link=HOW-TO:HelloWorld_addon|title=Hello World Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Screensaver-icon.png|link=HOW-TO:Screensaver_addon|title=Screensaver Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=script-icon.png|link=HOW-TO:Script_addon|title=Script Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Visualisation-icon.jpg|link=HOW-TO:Visualisation_addon|title=Visualisation Tutorial}}<br />
| width="12.5%" align="center" | {{Main page icon|image=video-icon.png|link=HOW-TO:Video_addon|title=Video Addon Tutorial}}<br />
|}<br />
----<br />
{{huge|'''{{color|black|Advanced}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="12.5%" align="center" | {{Main page icon|image=Unicode icon.jpg|link=Add-on unicode paths}}<br />
| width="12.5%" align="center" | {{Main page icon|image=501159.png|link=JSON-RPC API}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Book icon 1.png|link=Python_libraries|title=Kodi Python Libraries}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Boolean_operation_icon.jpg|link=List of boolean conditions}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Apps-Brackets-B-icon.png|link=List of built-in functions}}<br />
| width="12.5%" align="center" | {{Main page icon|image=shopping-list-generator-icon.png|link=InfoLabels|title=List of info labels}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Web-pdb-icon.png|link=Python_debugging|title=Python Debugging}}<br />
| width="12.5%" align="center" | {{Main page icon|image=Windowsicon.png|link=Window IDs|title=Window IDs}}<br />
|}<br />
<br />
----<br />
{{huge|'''{{color|black|Publishing}}'''}}<br />
{| width="100%"<br />
|- valign="top"<br />
| width="25%" align="center" | {{Main page icon|image=Thumbs up font awesome.png|link=Add-on rules}}<br />
| width="25%" align="center" | {{Main page icon|image=Upload-128.png|link=Submitting Add-ons}}<br />
| width="25%" align="center" | {{Main page icon|image=Thumbnail-symbol-transparent.png|link=Official_add-on_repository|title=Official Add-on Repository}}<br />
| width="25%" align="center" | {{Main page icon|image=Box_icon.png|link=Unofficial add-on repositories|title=Third-party Add-on Repositories}}<br />
|}<br />
----<br />
<br />
<br />
[[Category:Add-on development|*]]</div>SistemaRayoXPhttps://kodi.wiki/index.php?title=File:UI_sounds.png&diff=232832File:UI sounds.png2021-08-13T20:39:41Z<p>SistemaRayoXP: Icon for UI sounds add-on type (for add-on development page)</p>
<hr />
<div>== Summary ==<br />
Icon for UI sounds add-on type (for add-on development page)</div>SistemaRayoXP