How to export a list of tv shows/movies from XBMC to a text doc?
#1
Over the weekend my NAS hard drive failed... i have a backup of the media... but its 3 to 4 months old and i have added a lot of media since then.

Is there any way of exporting a list (text) of tv shows and movies from XBMCs library so i can cross check my files to see what i have lost?

Thanks.
Reply
#2
You can use the Video / Library /Export option to give you a list of everything in your XBMC Library.


If the data is in your folders, Go to a Command prompt in your media directory and type in :

c:\ Media> DIR /B /S *.AVI |List.txt

Will give you a list.txt of all AVI files. You can also run one for PM4, or MKV files just as easily. Or you could take off the *.AVI and it will list EVERY FILE.. then you can import it into Excel and sort by file extension, or delete all tbn or jpg files.. Lots of ways to do these...

However. MediaCenter Master can be used to generate a text or HTML list, and all you have ot do is point it at your directory structure. Instructions are all over the place for that option.

I use MCM to make my listing on my website so my family can see my library.


Hope that helps!
Reply
#3
Thanks, but the drive my media is on is no more - it failed... so i cannot extract any list from the drive with a command prompt or any other media centre program.

I do know about the export library XML feature in XBMC... but looking to see if there is any easier or faster way of doing this.

Reply
#4
Is your XBMC video library still intact? If so, export your video library as a single file. Open a terminal and use the cd command to switch over to the directory where the saved videodb.xml file is located and use a command such as this:
Code:
findstr "<title>" videodb.xml > "c:\path\to\videos_titles.txt"
This will save all the <title> statements from your exported XML file to a file named videos_titles.txt. The entries for your movies should be self-evident. For TV shows, you'll see something like this, where the show title is listed and then the episode titles for that show are listed below it and indented:
Code:
<title>Name of first TV show</title>
  <title>Episode 1 title</title>
  <title>Episode 2 title</title>
<title>Name of second TV show</title>
  <title>Episode 1 title</title>
  <title>Episode 2 title</title>
Not real pretty, but you can print out this text file and use it to check off which videos you have backups and which you need to re-acquire.
Reply
#5
For the benefit of any Linux users in the future who may search the forums for a similar requirement, here's the Linux equivalent command:
Code:
grep "<title>" videodb.xml > "/path/to/videos_titles.txt"
Everything else from the post above should be applicable to Linux as well as Windows.
Reply
#6
Thanks for that artrafael, I will give that a try when i get home tonight.

Reply
#7
(2012-12-04, 00:16)artrafael Wrote: Is your XBMC video library still intact? If so, export your video library as a single file. Open a terminal and use the cd command to switch over to the directory where the saved videodb.xml file is located and use a command such as this:
Code:
findstr "<title>" videodb.xml > "c:\path\to\videos_titles.txt"
This will save all the <title> statements from your exported XML file to a file named videos_titles.txt. The entries for your movies should be self-evident. For TV shows, you'll see something like this, where the show title is listed and then the episode titles for that show are listed below it and indented:
Code:
<title>Name of first TV show</title>
  <title>Episode 1 title</title>
  <title>Episode 2 title</title>
<title>Name of second TV show</title>
  <title>Episode 1 title</title>
  <title>Episode 2 title</title>
Not real pretty, but you can print out this text file and use it to check off which videos you have backups and which you need to re-acquire.

artrafael, that worked perfectly, Thank you sir... i am well on my way to cross checking what i have lost now and i should be back up and running XBMC by the weekend. Thank you again!
Reply
#8
Good solution above - but here's a slightly better one: http://forum.xbmc.org/showthread.php?tid=174930

Jest my two cents....
Image
Image
Image
Reply
#9
Seems like a lot of steps to go through but, hey, having options is always a good thing. Smile
Reply
#10
Hi,
My Hard Drive got corrupted too and I wanted a list of all the files for that particular Drive.

So, I followed these steps:

- Export full library: Video / Library /Export option. Make sure to export all in 1 file and it will create a directory structure like:
xbmc_videodb_2014-11-29\videodb.xml

(I'm on windows, so to run grep I used Cygwin)

- Suppose your HDD path is S:\_TV Series 1A
run following grep command:

Code:
$ grep "<path>S:\\\_TV Series 1A" xbmc_videodb_2014-10-29/videodb.xml > missing_files.txt

(Be sure to escape any slashes or underscores with backslashes)

This will give a list of all the directories and sub(season) directories for that path like:

Code:
<path>S:\_TV Series 1A\Being Erica\</path>
            <path>S:\_TV Series 1A\Being Erica\Season 1_720p\</path>
            <path>S:\_TV Series 1A\Being Erica\Season 1_720p\</path>
... and so on

If you want full filenames, then use this: "<filenameandpath>" instead of "<path>"

So command will be like:
Code:
grep "<filenameandpath>S:\\\_TV Series 1A" xbmc_videodb_2014-10-29/videodb.xml > missing_files.txt

Also there is a great add-on called Missing Movie Scanner if some files are missing and directory structure is still there.
You can find it here:
System -> Add-ons -> Video Add-ons -> Missing Movie Scanner
In its configuration Enable logging and save logs to a certain directory and it will create a file missing.txt with all missing files.
We can also configure which file extensions to search for.

-----------------
Hope this helps others facing the same issue.
Reply

Logout Mark Read Team Forum Stats Members Help
How to export a list of tv shows/movies from XBMC to a text doc?0