Sources.xml: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:sources.xml}}
{{warning|This page is for reference. Users should not edit sources.xml directly, but instead manage sources via the Kodi GUI.}}
'''sources.xml''' is the configuration file where XBMC stores your media source locations. In this section we will concentrate on xml syntax of sources and the various options that are available.<br />
{{cleanup}}
'''sources.xml''' is the configuration file where Kodi stores your media source locations. In this section we will concentrate on xml syntax of sources and the various options that are available.<br />


The configuration file ''sources.xml'' exists in the ''userdata folder''. It depends on your Operating System (Linux, Mac, XP, Vista) and if you changed the default settings during installation, where you can find your ''userdata folder''. See [[The UserData Folder|Advanced Topics/The UserData Folder]] to find out where you have to look.<br />
The configuration file ''sources.xml'' exists in the ''userdata folder''. It depends on your Operating System (Linux, Mac, XP, Vista) and if you changed the default settings during installation, where you can find your ''userdata folder''. See [[The UserData Folder|Advanced Topics/The UserData Folder]] to find out where you have to look.<br />


====XML Syntax and Source Breakdown====
==== XML Syntax and Source Breakdown ====
XML syntax is very similar to html syntax, but can be less forgiving. Lets first take a look at a source:
XML syntax is very similar to html syntax, but can be less forgiving. Lets first take a look at a source:
<code>
<code>
Line 12: Line 13:
         &lt;name&gt;Main Music Collection&lt;/name&gt;
         &lt;name&gt;Main Music Collection&lt;/name&gt;
         &lt;path&gt;smb://username:[email protected]/share/music/&lt;/path&gt;
         &lt;path&gt;smb://username:[email protected]/share/music/&lt;/path&gt;
        &lt;allowsharing&gt;true&lt;/allowsharing&gt;
       &lt;/source&gt;
       &lt;/source&gt;
     &lt;/music&gt;
     &lt;/music&gt;
</code>
</code>
=====Some basics to cover first=====
===== Some basics to cover first =====
:; Tags : Each word inside of <> symbols is called a 'tag'. Tags can either be starting, or ending tags. To make an ending tag you simply add a forward slash / to the beginning of the tag name. <tag> is a starting tag </tag> is an ending tag. Developers try to make tag names as self explanatory as possible. <name> for example is the name of the source.
:; Tags : Each word inside of <> symbols is called a 'tag'. Tags can either be starting, or ending tags. To make an ending tag you simply add a forward slash / to the beginning of the tag name. <tag> is a starting tag </tag> is an ending tag. Developers try to make tag names as self explanatory as possible. <name> for example is the name of the source.


Line 28: Line 30:
         &lt;path>smb://username:[email protected]/share/music/&lt;/path>
         &lt;path>smb://username:[email protected]/share/music/&lt;/path>
         &lt;thumbnail>E:\Apps\XBMC\media\music.png&lt;/thumbnail>
         &lt;thumbnail>E:\Apps\XBMC\media\music.png&lt;/thumbnail>
        &lt;allowsharing&gt;true&lt;/allowsharing&gt;
         &lt;lockmode>1&lt;/lockmode>
         &lt;lockmode>1&lt;/lockmode>
         &lt;lockcode>12345678&lt;/lockcode>             
         &lt;lockcode>12345678&lt;/lockcode>             
Line 34: Line 37:
</code>
</code>


=====Required Fields=====
===== Required Fields =====
:; <music></music>
:; <music></music>
:: This tag defines which section your source belongs to. Other valid sections are <programs> <videos> <pictures> and <files>. You cannot have multiple <music> sections in your xml file.
:: This tag defines which section your source belongs to. Other valid sections are <programs> <video> <pictures> and <files>. You cannot have multiple <music> sections in your xml file.
 
:; <default></default>
:: If you specify the '''''Name''''' of a source here, the contents of this source will be shown when you enter e.g. the Music section (this example) instead of the ''ROOT shares listing''.


:; <name></name>
:; <name></name>
Line 56: Line 56:
         &lt;path>F:\Music&lt;/path>
         &lt;path>F:\Music&lt;/path>
         &lt;path>smb://username:[email protected]/share/music/&lt;/path>
         &lt;path>smb://username:[email protected]/share/music/&lt;/path>
        &lt;allowsharing&gt;true&lt;/allowsharing&gt;
       &lt;/source>
       &lt;/source>
     &lt;/music>
     &lt;/music>
</code>
'''Podcast Example:'''
<code>
    &lt;video>
      &lt;source>
          &lt;name>podcast_Tekzilla Weekly</name>
          &lt;path pathversion="1">rss://revision3.com/tekzilla/feed/quicktime-high-definition/?subshow=false</path>
      &lt;/source>
    &lt;/video>
</code>
</code>


Line 66: Line 77:
     &lt;thumbnail>e:\media\images\videos.png&lt;/thumbnail>
     &lt;thumbnail>e:\media\images\videos.png&lt;/thumbnail>
</code>
</code>
All sources can have a custom [[thumbnail]] icon. The image must be located locally on the Xbox.
All sources can have a custom [[thumbnail]] icon.
|}
|}
'''Sharing / Remote access'''
{|
|
<code>
    &lt;allowsharing&gt;true&lt;/allowsharing&gt;
</code>
This parameter configure the permission to access the content of the source from Kodi Webserver and UPnP.
If set to true (Default value when source is added from GUI) then the content of the source can be accessed.
Set this value to false to disable remote access, while still allowing playback inside Kodi.
|}
== See also ==
* [[Adding videos to the library]]
* [[List of media source types]]
* [[File sharing]]
* [[Filemanager]]
{{DISPLAYTITLE:sources.xml}}


[[Category:Settings]]
[[Category:Settings]]
[[Category:Manual]]

Revision as of 23:54, 10 January 2020

Stop hand.png This page is for reference. Users should not edit sources.xml directly, but instead manage sources via the Kodi GUI.
Cleanup.png This page or section may require cleanup, updating, spellchecking, reformatting and/or updated images. Please improve this page if you can. The discussion page may contain suggestions.


sources.xml is the configuration file where Kodi stores your media source locations. In this section we will concentrate on xml syntax of sources and the various options that are available.

The configuration file sources.xml exists in the userdata folder. It depends on your Operating System (Linux, Mac, XP, Vista) and if you changed the default settings during installation, where you can find your userdata folder. See Advanced Topics/The UserData Folder to find out where you have to look.

XML Syntax and Source Breakdown

XML syntax is very similar to html syntax, but can be less forgiving. Lets first take a look at a source:

    <music>
      <default>Main Music Collection</default>
      <source>
        <name>Main Music Collection</name>
        <path>smb://username:[email protected]/share/music/</path>
        <allowsharing>true</allowsharing>
      </source>
    </music>

Some basics to cover first
Tags
Each word inside of <> symbols is called a 'tag'. Tags can either be starting, or ending tags. To make an ending tag you simply add a forward slash / to the beginning of the tag name. <tag> is a starting tag </tag> is an ending tag. Developers try to make tag names as self explanatory as possible. <name> for example is the name of the source.
Data
Between two tags is where any data associated with that source is stored. <tag>DATA</tag>. You can also store other tags inside of each other

Example:

    <music>
      <default>Main Music Collection</default>
      <source>
        <name>Main Music Collection</name>
        <path>smb://username:[email protected]/share/music/</path>
        <thumbnail>E:\Apps\XBMC\media\music.png</thumbnail>
        <allowsharing>true</allowsharing>
        <lockmode>1</lockmode>
        <lockcode>12345678</lockcode>             
      </source>
    </music>

Required Fields
<music></music>
This tag defines which section your source belongs to. Other valid sections are <programs> <video> <pictures> and <files>. You cannot have multiple <music> sections in your xml file.
<name></name>
The Name of the source. This will accept any characters in the current character set.
<path></path>
The path of the source. This can be a local path such as "e:\media\images\" or remote url such as "smb://username:password@serverip/path/". You may have more than one <path> tag in a single source, called multipaths. in Multipaths the directory listings will be combined. See Types of Media Sources for more information concerning paths.
* Multipath sources are restricted to local (PC or Xbox built-in hard drive), smb/samba, and xbms paths.
* The path can not be a playable object or an executable file, (ie a video, audio or .xbe file), it must be a share or a sub folder under a share.

Multipath Example:

    <music>
      <source>
        <name>Main Music Collection</name>
        <path>F:\Music</path>
        <path>smb://username:[email protected]/share/music/</path>
        <allowsharing>true</allowsharing>
      </source>
    </music>

Podcast Example:

    <video>
      <source>
         <name>podcast_Tekzilla Weekly</name>
         <path pathversion="1">rss://revision3.com/tekzilla/feed/quicktime-high-definition/?subshow=false</path>
      </source>
    </video>

Thumbnails

    <thumbnail>e:\media\images\videos.png</thumbnail>

All sources can have a custom thumbnail icon.

Sharing / Remote access

    <allowsharing>true</allowsharing>

This parameter configure the permission to access the content of the source from Kodi Webserver and UPnP.

If set to true (Default value when source is added from GUI) then the content of the source can be accessed.

Set this value to false to disable remote access, while still allowing playback inside Kodi.

See also