2011-12-27 18:54:25 +00:00
|
|
|
// filebot -script "http://filebot.sf.net/scripts/mi.groovy" -trust-script /path/to/media/ "MediaIndex.csv"
|
2011-11-02 18:19:09 +00:00
|
|
|
|
|
|
|
/*
|
2011-12-10 10:02:09 +00:00
|
|
|
* Print media info of all video files to CSV file
|
2011-11-02 18:19:09 +00:00
|
|
|
*/
|
2011-12-10 10:02:09 +00:00
|
|
|
def model = 'Name;Container;Resolution;Video Codec;Video Format;Audio Codec;Audio Format;Audio Language(s);Duration;File Size;Path'
|
|
|
|
def template = '{fn};{cf};{resolution};{vc};{vf};{ac};{af};{media.AudioLanguageList};{media.DurationString3};{file.length()};{file.getCanonicalPath()}'
|
|
|
|
|
|
|
|
// open destination file (writing files requires -trust-script)
|
|
|
|
args[1].withWriter{ output ->
|
|
|
|
// print header
|
|
|
|
output.writeLine(model)
|
|
|
|
|
|
|
|
// print info for each video file (sorted by filename)
|
|
|
|
args[0].getFiles{ it.isVideo() }.sort{ a, b -> a.name.compareToIgnoreCase(b.name) }.each{
|
|
|
|
def mi = getMediaInfo(file:it, format:template)
|
|
|
|
|
|
|
|
// print to console
|
|
|
|
println mi
|
|
|
|
|
|
|
|
// append to file
|
|
|
|
output.writeLine(mi)
|
|
|
|
}
|
|
|
|
}
|