About
FileBot makes scripting and automation as easy as it gets. Just script everything in Groovy instead of bothering with cumbersome cmd and bash scripts. It's the same on all platforms and much more powerful. The provided functions are the same as in the CLI and parameter usage is also exactly the same.
Examples
Running Scripts
filebot -script "path/to/script.groovy" args...
Execute a given Groovy script. Parameters defined on the cmdline when starting a script will serve as default parameters
while running that script.
Script Repository
Find scripts for common tasks here. You can just use these scripts straight away or as a reference for building your own more advanced scripts. If you wrote a really useful script please share it with us.
- µTorrent / Deluge / Transmission Integration
- Fetch Artwork and Nfo for TV Shows
- Fetch Artwork and Nfo for Movies
- Fetch all subtitles
- The Cleaner - Delete left over files and folders
- View or Clear Extended Attributes
- Filename: Find & Replace
- Convert Absolute to SxE numbers
- Media Index CSV
- Query Rename History
- Revert Renamed Files to their Original Names
- MyEpisodes.com Integration
- Rename All Media Folder by Folder
- Auto-Sort Tivo Recordings
- Sort out TV Download Folder
- Watch folder and rename new episodes
Example Scripts
args.eachMediaFolder {
getMissingSubtitles(folder:it)
rename(folder:it)
compute(file:it.listFiles{ it.isVideo() })
}
Fetch subtitles, rename and compute checksums for all media folders in the file hierarchy.['E:/TV Shows' as File].eachMediaFolder{ rename(folder:it, db:'TheTVDB') }
['E:/Anime' as File].eachMediaFolder{ rename(folder:it, db:'AniDB') }
['E:/Movies' as File].eachMediaFolder{ rename(folder:it, db:'TheMovieDB') }
Run rename on different folder hierarchies using different episode/movie datasources.args.getFiles{ it.isVideo() }
.sort{ a, b -> a.name.compareTo(b.name) }
.each{ println getMediaInfo(file:it, format:'{fn} [{vf} {vc} {af}]') }
Print media info for all video files using the given format pattern.Function Reference source
Rename media files
File[] rename(folder|file, query, output, format, db, lang, strict)
- Parameters:
- folder - process media files in this folder
- file - process these media files
- action - rename action name or closure
- conflict - define conflict handling
- output - output folder, if format expression is not absolute
- format - episode/movie naming scheme
- db - episode/movie database
- query - force series/movie name, auto-detect if not set
- sortOrder - episode sort order
- filter - episode filter expression
- lang - preferred language for episode/movie titles
- strict - turn on/off strict matching
Fetch subtitles for media files
File[] getSubtitles(folder|file, query, lang, output, encoding, strict)
getMissingSubtitles
so subtitles that have already been downloaded will not be downloaded again overridding existing subtitle files.
- Parameters:
- folder - process media files in this folder
- file - process these media files
- db - database filter expression (e.g. opensubtitles|subscene)
- query - lookup subtitles by series/movie name
- lang - subtitle language
- output - force output format (e.g. srt)
- encoding - force output charset
- strict - enable matching subtitles via filename
File verification
boolean check(folder|file)
- Parameters:
- folder - check the sfv/md5/sha1 files in this folder
- file - check these sfv/md5/sha1
File compute(folder|file, output, encoding)
- Parameters:
- folder - compute checksums for files in this folder
- file - compute checksums for these files
- output - absolute or relative output file or just output format (sfv, md5 or sha1)
- encoding - output charset, defaults to UTF-8
Other
File[] extract(folder|file, output)
- Parameters:
- folder - extract all archives that are in this folder
- file - extract this archive
- output - output folder, defaults to archive path
- conflict - define conflict handling
String[] fetchEpisodeList(query, format, db, lang)
- Parameters:
- query - tv series name
- format - episode naming scheme
- db - episode database
- sortOrder - episode sort order
- lang - preferred language for episode titles
String getMediaInfo(file, format)
- Parameters:
- file - get info for this file
- format - media naming scheme
Extras
Need some help getting started? Check the forums.