Page 1 of 1

File Info/Metadata into CSV

Posted: 27 Sep 2013, 23:31
by jkingaround
Hey so I stumbled onto this program and I think it's perfect to suit my needs. I'm trying to create a .csv file to import into a MySQL database. I found the http://filebot.net/scripts/mi.groovy script and I'm wondering what the easiest way to search for metadata from IMDB and TVDB and write that to a CSV? I'd probably want 2 .csv files one for movies and one for TV. the info I'd want is the plot, genres, imdb link for movies and then TV just a plot for the show and a plot for the episode. Is this possible? Thanks.

Re: File Info/Metadata into CSV

Posted: 28 Sep 2013, 09:04
by rednoah
The current script doesn't do any detection so you'll only have filename/mediainfo (not genre, imdb id, etc) data to work with.

Doing all that detection logic to the script won't be easy. Best thing would be to first rename files with filebot, and as long as xattr is enabled the files will be tagged and all the metadata will be readily available later on.

Re: File Info/Metadata into CSV

Posted: 28 Sep 2013, 09:12
by jkingaround
i'm aware that the script doesn't do any of that. my question is (if this is possible) to make a CSV with the metadata without actually renaming anything?

Re: File Info/Metadata into CSV

Posted: 28 Sep 2013, 09:18
by rednoah
Not impossible anyway. You can play with the view xattr script if that'll give u some useful information.

So doable, but quite a bit of work.

Re: File Info/Metadata into CSV

Posted: 28 Sep 2013, 09:45
by jkingaround
Where's the documentation on xattr? I'm just wondering how to print those out to a .csv file

Re: File Info/Metadata into CSV

Posted: 28 Sep 2013, 13:37
by rednoah
You can take this as a reference:
http://www.filebot.net/forums/viewtopic ... &t=5#p5394

You can learn from this one and other scripts, and then code things yourself and create .csv files the way you like.

PS: If coding is not your thing, then this is not possible for you at this point.

Re: File Info/Metadata into CSV

Posted: 28 Sep 2013, 20:37
by jkingaround
Thanks for that. I do code which is the reason I'm looking at this as an option but the documentation is less than clear for certain things but i'll see what that does when I get a chance. Thanks.

EDIT: I took a look at it but it seems to only print if the file already has the xattr? where do they originally get set?

Re: File Info/Metadata into CSV

Posted: 29 Sep 2013, 05:21
by rednoah
xattr metadata gets set when you rename files with filebot. So this will only work for collections that have already been renamed with filebot.

Re: File Info/Metadata into CSV

Posted: 29 Sep 2013, 05:59
by jkingaround
Alright that's a problem. I dont really need to rename anything as it's already nice and human readable but I'd like to just export that metadata..

Re: File Info/Metadata into CSV

Posted: 29 Sep 2013, 09:43
by rednoah
Sorry, there's no script for thug the at this point. And it'd be extremely hard.

You could try doing rename(...) calls but then passing in your own dummy rename closure that just does nothing. Chef the sample snippets for how to override the rename action.