XBMC v13.1 "Gotham" has been released! See Gotham FAQ for details.

sources.xml

From XBMC
Jump to: navigation, search
Stop hand.svg This page is for reference. Users should not edit sources.xml directly, but instead manage sources via the XBMC 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 XBMC 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.

Contents

1 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:password@server.com/share/music/</path>
      </source>
    </music>

1.1 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:password@server.com/share/music/</path>
        <thumbnail>E:\Apps\XBMC\media\music.png</thumbnail>
        <lockmode>1</lockmode>
        <lockcode>12345678</lockcode>             
      </source>
    </music>

1.2 Required Fields
<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.
<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:password@server.com/share/music/</path>
      </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.

2 See also

Personal tools
Namespaces

Variants
Actions
Navigation
Wiki help
Toolbox