diff --git a/website/base.css b/website/base.css index c5be6b89..a1e90cde 100644 --- a/website/base.css +++ b/website/base.css @@ -25,6 +25,12 @@ h3 { margin-bottom: -8px; } +hr { + border-style: dashed; + border-width: 1px 0 0 0; + border-color: lightgray; +} + .section h2.reference { padding-top: 25px; } @@ -180,9 +186,8 @@ div.screencast:hover .play { margin-bottom: 20px; } -.section p { - margin-left: 10px; - margin-right: 0px; +.section p, .section .description { + margin: 16px 0 0 10px; } .section .quote { diff --git a/website/code.css b/website/code.css index 91964f47..d89de6a8 100644 --- a/website/code.css +++ b/website/code.css @@ -9,15 +9,26 @@ code { margin: 5px 0px; } +pre { + margin: 0px; +} + code .variable { color: #7f0055; font-weight: bold; } -code .method { +code .method, div.documentation pre .method { color: #0066cc; } +code .property, div.documentation pre .property { + color: #225577; + font-size: 11pt; + font-weight: bold; + font-family: monospace; +} + code .string, code .numeral, code .regex { color: #008800; } @@ -39,3 +50,41 @@ code .option { code .argument { color: #008800; } + + +div.documentation { + font-size: 11pt; + padding: 5px; + border: 1px solid #9EADC0; + background-color: #F8F8FF; + margin-bottom: 20px; +} + +div.documentation h4 { + margin: -5px -5px 5px -5px; + background-color: #DEE3E9; + border-bottom: 1px solid #9EADC0; + padding: 2px 5px; +} + +div.documentation pre { + font-size: 13pt; + margin-top: 5px; + margin-bottom: 5px; +} + +div.documentation dt { + margin-bottom: 3px; + color: #4E4E4E; + font-size: 10pt; + font-weight: bold; +} + +div.documentation .return { + color: #4C6B87; + font-size: 10pt; +} + +div.documentation .property { + color: #225577; +} diff --git a/website/images/script.png b/website/images/script.png new file mode 100644 index 00000000..930fd87d Binary files /dev/null and b/website/images/script.png differ diff --git a/website/script.html b/website/script.html new file mode 100644 index 00000000..1402d7ed --- /dev/null +++ b/website/script.html @@ -0,0 +1,192 @@ + + + + Script CLI + + + + + + + + + + + + + + +
+
+
+ +
+
+ +
+
+ +
+ +

+ Script CLI + Scripting interface usage manual +

+
+ +
+
+ See Examples + Anything is possible +
+
+

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. Find scripts for common tasks here. +

+ + +

Example Scripts

+ +
+
args.eachMediaFolder {
+	getSubtitles(folder:it)
+	rename(folder:it)
+	compute(file:it.listFiles().findAll{ it.isVideo() })
+}
Fetch subtitles, rename and compute checksums for all media folders in the file hierarchy.
+ +
+
['E:/tvshows'].eachMediaFolder{ rename(folder:it, db:'tvrage') }
+['E:/anime'].eachMediaFolder{ rename(folder:it, db:'anidb') }
+['E:/movies'].eachMediaFolder{ rename(folder:it, db:'opensubtitles') }
+
Run rename on different folder hierarchies using different episode/movie datasources.
+ +
+
args.getFiles().findAll{ 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, format, db, lang, strict)
+
Match files with episode/movie data and rename according to given naming scheme.
+
+
Parameters:
+
folder - process media files in this folder
+
file - process these media files
+
query - force series/movie name, auto-detect if not set
+
format - episode/movie naming scheme
+
db - episode/movie database
+
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)
+
Download subtitles for the given given files. Lookup subtitles via hash or filename as fallback.
+
+
Parameters:
+
folder - process media files in this folder
+
file - process these media files
+
query - series/movie name
+
lang - subtitle language
+
output - force output format (e.g. srt)
+
encoding - force output charset
+
+
+ +
+

File verification

+
boolean check(folder|file)
+
Check given sfv/md5/sha1 files.
+
+
Parameters:
+
folder - check the sfv/md5/sha1 files in this folder
+
file - check these sfv/md5/sha1
+
+
+
File compute(folder|file, output, encoding)
+
Compute sfv/md5/sha1 for the given files.
+
+
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

+
String[] fetchEpisodeList(query, format, db, lang)
+
Fetch episode data for the given tv show and format episode names.
+
+
Parameters:
+
query - tv series name
+
format - episode naming scheme
+
db - episode database
+
lang - preferred language for episode titles
+
+
+
String getMediaInfo(file, format)
+
Get mediainfo as defined by the given format.
+
+
Parameters:
+
file - get info for this file
+
format - media naming scheme
+
+
+
+ + +
+
+ +