File Bot wont extract
Posted: 01 May 2012, 13:59
I got this code snipet from my modifed sorty.groovy script
I calling the script like this:
filebot -script "G:\Media Files\Completed\sorty.groovy" -non-strict -trust-script "-Xut_dir=G:\Media Files\Completed\Movies\Test" "-Xut_file=%F" "-Xut_label=Movies" "-Xut_state=%S" "-Xut_kind=%K"
Inside the Test folder there is a compressed movie with rar files.
I'm using the lastest version of FileBot: filebot-2.61-r990-include.jar
Im not getting any errrors and the println statment is being print out
Thank you in advance
This is the rest of the code
I calling the script like this:
filebot -script "G:\Media Files\Completed\sorty.groovy" -non-strict -trust-script "-Xut_dir=G:\Media Files\Completed\Movies\Test" "-Xut_file=%F" "-Xut_label=Movies" "-Xut_state=%S" "-Xut_kind=%K"
Inside the Test folder there is a compressed movie with rar files.
I'm using the lastest version of FileBot: filebot-2.61-r990-include.jar
Code: Select all
// extract completed multi-volume rar files
// extract all archives found in this folder
if (!new File(ut_dir).hasFile{ incomplete(it) } && new File(ut_dir).hasFile{ it =~ /[.]rar$/ }) {
println "Extracting Video Processing $ut_dir"
def paths = extract(folder:ut_dir)
// delete original archive volumes after successful extraction
if (paths != null && !paths.isEmpty()) {
ut_dir.listFiles{ it =~ /[.]rar$|[.]r[\d]+$/ }*.delete()
}
}
Thank you in advance
This is the rest of the code
Code: Select all
// filebot -script "sorty.groovy" -non-strict -trust-script "-Xut_dir=%D" "-Xut_file=%F" "-Xut_label=%L" "-Xut_state=%S" "-Xut_kind=%K"
// PERSONALIZED SETTINGS
def episodeDir = "G:/Media Files/Completed/TV"
def episodeFormat = "G:/Media Files/TV/{n}/Season {s}/{n} - {s00e00} - {t}"
def movieDir = "G:/Media Files/Completed/Movies"
def movieFormat = "G:/Media Files/Movies/{n} ({y})/{n} ({y})"
def animeDir = "G:/Media Files/Completed/Anime"
def animeFormat = "G:/Media Files/Anime/{n}/Season {s}/{n} - {s00e00} - {t}"
// XBMC ON LOCAL MACHINE
def xbmc = [] // (use [] to not notify any XBMC instances about updates)
// ignore chunk, part, par and hidden files
def incomplete(f) { f.name =~ /[.]incomplete|[.]chunk|[.]par$|[.]dat$/ || f.isHidden() }
//Remove Sample Video
if (!new File(ut_dir).hasFile{ incomplete(it) } ) {
println "Deleting Sample Video Processing $ut_dir"
def files = new File(ut_dir).listFiles{ it.isVideo() }
// if name contains "sample" and filesize is less than 20 MB
//def selection = args.getFiles{ it.name =~ "sample" && it.length() < 20 * 1024 * 1024}
def selection = new File(ut_dir).getFiles{ (it.name =~ "sample" || it.name =~ "Sample") && it.length() < 150 * 1024 * 1024}
selection.each{ println "delete $it" }
// delete all
selection*.delete()
}
// extract completed multi-volume rar files
// extract all archives found in this folder
if (!new File(ut_dir).hasFile{ incomplete(it) } && new File(ut_dir).hasFile{ it =~ /[.]rar$/ }) {
println "Extracting Video Processing $ut_dir"
def paths = extract(folder:ut_dir)
// delete original archive volumes after successful extraction
if (paths != null && !paths.isEmpty()) {
ut_dir.listFiles{ it =~ /[.]rar$|[.]r[\d]+$/ }*.delete()
}
}
//Remove Sample Video
if (!new File(ut_dir).hasFile{ incomplete(it) } ) {
println "Deleting Sample Video Processing $ut_dir"
def files = new File(ut_dir).listFiles{ it.isVideo() }
// if name contains "sample" and filesize is less than 20 MB
//def selection = args.getFiles{ it.name =~ "sample" && it.length() < 20 * 1024 * 1024}
def selection = new File(ut_dir).getFiles{ (it.name =~ "sample" || it.name =~ "Sample") && it.length() < 150 * 1024 * 1024}
selection.each{ println "delete $it" }
// delete all
selection*.delete()
}
//Fetch subtitles and sort into folders
//TV
if (ut_label == "TV") {
println "TV Processing $ut_dir"
files = new File(ut_dir).listFiles{ it.isVideo() }
// fetch subtitles
//files += getSubtitles(file:files)
// sort episodes / subtitles
rename(file:files, db:'TVRage', format:episodeFormat)
}
//Movies
if (ut_label == "Movies") {
println "Movies Processing $ut_dir"
files = new File(ut_dir).listFiles{ it.isVideo() }
// fetch subtitles
//files += getSubtitles(file:files)
// sort movies / subtitles
rename(file:files, db:'TheMovieDB', format:movieFormat)
}
//Anime
if (ut_label == "Anime") {
println "Anime Processing $ut_dir"
files = new File(ut_dir).listFiles{ it.isVideo() }
// fetch subtitles
//files += getSubtitles(file:files)
// sort episodes / subtitles
rename(file:files, db:'anidb', format:animeFormat)
}
// make XBMC scan for new content
xbmc.each { host ->
telnet(host, 9090) { writer, reader ->
// API call for latest XBMC release
def msg = '{"id":1,"method":"VideoLibrary.Scan","params":[],"jsonrpc":"2.0"}'
// API call for XBMC Dharma-Release or older
// def msg = '{"id":1,"method":"VideoLibrary.ScanForContent","params":[],"jsonrpc":"2.0"}'
writer.println(msg)
}
}