XBMC will be renamed to Kodi for v14. Read here for more details
Various pages on the wiki might contain old references to "XBMC", but will most often still apply to "Kodi". Find out how you can help here.

Import-export library

From Kodi
Revision as of 20:56, 21 July 2009 by Althekiller (Talk)

Jump to: navigation, search
Incomplete.png INCOMPLETE:
This page or section is incomplete. Please add information or correct uncertain data which is marked with a ?
Home icon grey.png   ▶ Import-export library

XBMC offers the capability to import and export data manually into/from the Media Library.


1 Import / Export options

The Import / Export options can be found in Relevant Music / Videos Settings.

Video Library:

Export Video Library
Exports the Library database to either one, or multiple XML files. When you initiate an export, XBMC will ask if you want to export to separate or a single file.
If you choose to export to separate files you will also be asked if you want to export thumbnails and fanart as well.
The resulting XML nfo file and associated image files will then be exported to the location of the corresponding video files.
Import Video Library
Imports an XML file into the Library database. If the entry does not exist it is appended.
If it exists:
  1. It removes all current info for that entry from the database.
  2. Inserts the info for that entry from the XML file.
  • Note: If you wish to import a movie, TV show, music video or episode into the library, use the corresponding format in the exported xml file and enclose it with the <videodb></videodb> tags. Examples can be seen below, as nfo files.

Music Library:

Export Music Library
Exports the Library database to XML files.
Import Music / Video Library
Imports a XML file into the Library database. If the entry does not exist it is skipped.
If it exists:
  1. It removes all current info for that entry from the database.
  2. Inserts the info for that entry from the XML file.

2 Video nfo Files

Nfo files can be used to provide data for a video file in XBMC or influence the search behavior of scrapers. In particular they are helpful if the information fetched from a web site does not match the video file, or data for that particular file does not exist.

By default at the time of scanning, if the media folder contains a correctly named *.nfo file, then XBMC will load the *.nfo file and attempt to either, in the case of it containing XML data get the metadata directly from the nfo file or will parse it for a direct URL to the scraper info page. This allows XBMC to skip it's normal lookup and/or search procedures, useful if a file's information is not available on any of the scraper sites, or if the filematching criteria fails for the particular file.

2.1 Video nfo Files containing XML data

1. The *.nfo file is an XML file containing the data for inclusion in the library.

2.1.1 Movies

Movie.nfo will override all and any nfo files in the same folder as the media files. If there is only one nfo file in a folder, The scraper will use it for all media files in that folder. If there are multiple media files in a folder, the *.nfo must be named exactly the same as the video file it is representing (ie. moviename.avi and moviename.nfo). In the case of multi-part (stacked) video stacking, name the file either moviename.nfo or moviename-CD1.nfo where the first filename is moviename-CD1.avi.


       <title>Who knows</title>
       <originaltitle>Who knows for real</originaltitle>
       <outline>A look at the role of the Buckeye State in the 2004 Presidential Election.</outline>
       <plot>A look at the role of the Buckeye State in the 2004 Presidential Election.</plot>
       <runtime>90 min</runtime>
       <mpaa>Not available</mpaa>
       <filenameandpath>c:\Dummy_Movie_Files\Movies\...So Goes The Nation.avi</filenameandpath>
       <director>Adam Del Deo</director>
           <name>Paul Begala</name>
           <name>George W. Bush</name>
           <name>Mary Beth Cahill</name>
           <name>Ed Gillespie</name>
           <name>John Kerry</name>


2.1.2 TV Shows

The filename of the NFO should be "tvshow.nfo" (Exact, NOT the name of the actual TV show) and it should be in the root folder of the TV show.
The nfo xml file may contain a valid <episodeguideurl> to allow online updates. If not, only episodes with nfo files will be added.


       <title>My TV Show</title>
       <plot>The best TV show in the world</plot>
   	<genre>Action and Adventure / Drama</genre>
           <name>Big John</name>
           <role>Jack of all trades</role>


2.1.3 TV Episodes

The *.nfo must be named exactly as the episode filename (i.e. episodename.avi and episodename.nfo) and in the same folder, allowing multiple episode and *.nfo files within the same folder.
For multi-part episodes, simply add multiple <episodedetails> XML blocks in succession.


       <title>My TV Episode</title>
       <plot>he best episode in the world</plot>
       <director>Mr. Vision</director>
           <name>Little Suzie</name>
           <role>Pole Jumper/Dancer</role>


2.1.4 Music Videos

The filename of the NFO should be the same as the music video file, only replacing the original extension with .nfo.
i.e. Bestartistintheworld - Bestsongintheworld.avi should have the corresponding nfo filename Bestartistintheworld - Bestsongintheworld.nfo.


       <plot>Scantly clad women hoing about</plot>
       <director>and I</director>
       <studio>Ego prod.</studio>


2.2 Video nfo files containing an URL

2. The *.nfo file contains a URL of the information page to scrape. The file can include other information (i.e. scene info), XBMC will scan through it and use a relevant URL if a match is found.

The scraper tries to match url's to all scrapers of the content type a dir is set to. E.g. if you set the content type to movies all movie scrapers check nfo files for a matching url. This means that nfo's override the scraper setting. I.e. a directory is set to use the imdb scraper but you have a german movie in it. Simply create a nfo for that movie with the ofdb link in it and you are sorted!

2.2.1 Movies

Movie.nfo will override all and any nfo files in the same folder as the media files.

Moviename.nfo where Moviename is the name of the movie file that points to a movie on IMDb.com.

If you use the "Use Foldername for Lookups" scraper setting XBMC will use the first nfo file it finds in the folder and apply it to any valid video file it finds in the same folder.


2.2.2 TV Shows

Filename should be tvshow.nfo (Exact, NOT the name of the TV show) in the root folder of the TV Show that points to a show on TheTVDB.com.


2.2.3 TV Episodes

Episodename.nfo where Episodename is the name of the episode file.
Not currently supported!


2.2.4 Music Videos

Mvideo.nfo where Mvideo is the name of the music video file that points to a music video on MTV.com


2.3 Video nfo files containing a mix of XML and URL

You can also create nfo files that contain both XML data and an URL. This is useful for instance, if you want the entry in your database to have another name than the one officially provided by the scraper.

Example: <xml> <movie>

   <title>Sin City (Recut, Extended, Unrated)</title>
   <runtime>147 min.</runtime>

</movie> http://www.imdb.com/title/tt0401792/ </xml>

By default the xml entry is added to the scraped entry in the database and may result in some duplicates. If you want to completely override the scraped result you need to set a clear attribute for the relevant xml tag in the nfo file.

Example: <xml>

   <genre clear="true">Action</genre> <genre>Horror</genre> <genre>Thriller</genre>
   <director clear="true">Frank Miller</director> <director>Robert Rodriguez</director> <director>Quentin Tarantino</director>


Currently supported tags for the clear attribute are genre, director, studio, actor, credits and artist for Music Videos.

3 Importing library information from "My Movies" media management software

My Movies (www.mymovies.name) is an online database for profiling DVD-Video movies. My Movies saves an XML file and a poster cover image which with this patch will get scanned by XBMC in the same way as XBMC's own XML formatted NFO files are scanned/scraped.

XBMC have the ability to the import movie library information from "My Movies" via the mymovies.xml files that it generates, and these mymovies.xml are prioritized over NFO files.

4 Music nfo files

4.1 Music nfo Files containing XML data

4.1.1 Artists

This information is missing, please help by contributing the relevant information.

4.1.2 Albums


 <title>The Album Title</title>
 <artist clear=true>First Artist</artist>
 <artist>Second Artist</artist>
 <artist>Nth Artist</artist>
 <genre clear=true>First Genre</genre>
 <genre>Second Genre</genre>
 <genre>Nth Genre</genre>
 <style clear=true>First Style</style>
 <style>Second Style</style>
 <style>Nth Style<style>
 <mood clear=true>First Mood</mood>
 <mood>Second Mood</mood>
 <mood>Nth Mood</mood>
 <theme clear=true>First Theme</theme>
 <theme>Second Theme</theme>
 <theme>Nth Theme</theme>
 <review>Album review text</review>
 <releasedate>Album release date</releasedate>
 <label>Record label the album was released under</label>
 <type>Erm...EP/LP? CD,Vinyl,DVDA,etc? I dunno</type>
 <year>Year album was released</year>
 <rating>Rating out of 5?<rating>
   <position>Track Number (1)</position>
   <title>Title of first track</title>
   <duration>Length of first track (XXX min, MM:SS)</duration>
   <position>Track Number (N)</posistion>
   <title>Title of Nth track</title>
   <duration>Length of Nth track</duration>


NOTE: Where indicated, tags can accept an optional "clear" boolean (true/false) attribute which clears all values of similar tags up to that point.

4.2 Music nfo files containing an URL

4.2.1 Artists

Artist.nfo in the artis folder that points to the corresponding artist page on Allmusic.com.


Artist.nfo assumes an artist/album directory layout

4.2.2 Albums

Album.nfo in the album folder that points to the corresponding album page on Allmusic.com.

Personal tools

Wiki help