Import-export library

From Official Kodi Wiki
Jump to navigation Jump to search
Incomplete.png INCOMPLETE:
This page or section is incomplete. Please add information or correct uncertain data which is marked with a ?

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

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 an XML file.
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.

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.

The Different nfo Options:

Video File nfo as an XML file

1. The *.nfo file is an XML file containing the data directly.

Movie Example:
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.

<xml>

   <movie>
       <title>Who knows</title>
       <rating>6.100000</rating>
       <year>2006</year>
       <top250>0</top250>
       <votes>50</votes>
       <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>
       <tagline></tagline>
       <runtime>90 min</runtime>
       <thumb>http://ia.ec.imdb.com/media/imdb/01/I/25/65/31/10f.jpg</thumb>
       <mpaa>Not available</mpaa>
       <watched>false</watched>
       <imdbnumber>tt0432337</imdbnumber>
       <filenameandpath>c:\Dummy_Movie_Files\Movies\...So Goes The Nation.avi</filenameandpath>
       <genre></genre>
       <credits></credits>
       <director>Adam Del Deo</director>
       <actor>
           <name>Paul Begala</name>
           <role>Himself</role>
       </actor>
       <actor>
           <name>George W. Bush</name>
           <role>Himself</role>
       </actor>
       <actor>
           <name>Mary Beth Cahill</name>
           <role>Herself</role>
       </actor>
       <actor>
           <name>Ed Gillespie</name>
           <role>Himself</role>
       </actor>
       <actor>
           <name>John Kerry</name>
           <role>Himself</role>
       </actor>
   </movie>

</xml>

TV Show Example:
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.

<xml>

   <tvshow>
       <title>MyTV Show</title>
       <rating>9.900</rating>
       <year>2000</year>
       <top250>0</top250>
       <episode>24</episode>
       <votes></votes>
       <outline></outline>
       <plot>The best TV show in the world<plot>
       <tagline></tagline>
       <runtime></runtime>
       <genre>Action and Adventure / Drama</genre>
       <credits></credits>
       <director></director>
       <premiered>2000-01-01</premiered>
       <status></status>
       
       <aired></aired>
       <studio></studio>
       <album></album>
       <trailer></trailer>
       <actor>
           <name>Big John</name>
           <role>Jack of all trades</role>
           <thumb></thumb>
       </actor>
   </tvshow>

</xml>

TV Episode Example:
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.

<xml>

   <episodedetails>
        <title>My TV Episode</title>
        <rating>10.000000</rating>
        <season>2</season>
        <episode>1</episode>
        <plot>he best episode in the world<plot>
        <actor>
           <name>Little Suzie</name>
           <role>Pole jumper/dancer</role>
       </actor>
   </episodedetails>

</xml>

Music Video Example:
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.

<xml>

   <musicvideo>
       <title>Bestsongintheworld</title>
       <artist>Bestartistintheworld</artist>
       <album>Me</album>
       <genre>Pop</genre>
       <runtime>3:20</runtime>
       <plot>Scantly clad women hoing about</plot>
       <year>2000</year>
       <director>and I</director>
       <studio>Ego prod.</studio>
   </musicvideo>

</xml>

Nfo 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!

Movie Example:
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.

http://www.imdb.com/title/tt0333766

TV Show Example:
TVShow.nfo in the root folder of the TV Show that points to a show on TheTVDB.com.

http://thetvdb.com/index.php?tab=series&id=73545

TV Episode Example:
Episodename.nfo where Episodename is the name of the episode file.
Not currently supported!

http://thetvdb.com/?tab=episode&seriesid=73545&seasonid=5950&id=117847&lid=7

Music Video Example:

http://www.mtv.com/overdrive/?artist=983&vid=222165

Music nfo files

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

http://www.allmusic.com/cg/amg.dll?p=amg&sql=11:gifoxqwkldae

Artist.nfo assumes an artist/album directory layout

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

http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:kifoxqualdde