Need help for beginner in scripting

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
polux400
Posts: 10
Joined: 09 Sep 2012, 01:06

Need help for beginner in scripting

Post by polux400 »

hello,

First of all, i want to thank the owner of Filebot (rednoah) for this awesome tool ! ;)

Atm, i use Filebot Gui using drag&drop function for my movies or tv shows (full seasons).

As i'm trying to create a fully automatized media center with Plex + SickBeard + CouchPotato + Sabnzb, i'm really interested in the CLI / script function of Filebot !

My problem is that i don't get how to use all the CLI and scripts I've found on this forum (here for example : http://filebot.sourceforge.net/cli.html)
I've read the FAQ and looking on the forum or google, but I still don't get it.
I've downloaded Groovy (I don't understand how to use it lol !) because apparently I need it to run the script I want.
To summarize, I just need to run a batch, may be each day, to get the missing subtitles of all my collection of movies/tv show. All the rename and management is done by sick beard and sabnzbd.
I've found this piece of script who seems to be perfect for me (source here: http://filebot.sourceforge.net/script.html) :

Code: Select all

args.eachMediaFolder {
	getMissingSubtitles(folder:it)
	rename(folder:it)
I try to put the lines of codes or the name of the "script.groovy" in the cmd of my windows, or in the windows scheduler tasks but nothing happen... (or some errors).

My needs :
- Everyday (or when i want to force it), execute an automatic script
- This script will search for my missing subtitles (tv show and movies), download and rename them (as the videos files)
- i need for each video, subtitles in english and in french.
- bonus : create a log of what has been downloaded :)

My questions :
- How can i launch a script (i need a really newbie tuto :/)?
- Which script is good for my needs ?
- how do i know that a script is right ? (testing)
- How can i easily automatized a script (a daily batch for example) ?


So, can somebody help me to understand how to use the scripts/groovy/CLI/task scheduler with filebot ?
Thanks a lot in advance !! :|


My informations :
OS : windows 7 64bits
Filebot : v3.0 (folder : "c:\filebot")
my root TV webshow folder (for example) : "D:\series"
- I have a "tvshows" folder and differents "movie" folder (by categories)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need help for beginner in scripting

Post by rednoah »

Open the console:

Run:

Code: Select all

filebot -get-missing-subtitles -r "X:/Movies" --lang en -non-strict
This might work better if things are already organized into folders:

Code: Select all

filebot -script fn:suball "X:/Movies" --lang en -non-strict
Do the same for --lang fr and setup some sort of auto-run once a day with windows scheduler.
:idea: Please read the FAQ and How to Request Help.
polux400
Posts: 10
Joined: 09 Sep 2012, 01:06

Re: Need help for beginner in scripting

Post by polux400 »

When you say "open the console", do i have to use "cmd" in windows ? Because i think i have to specify the folder of "filebot" in the CLI, but don't really know how.

This is what i have now, but doesnt seem to work (see pic in attachment).

My filebot folder is "c:\Filebot"

thanks for your help !!

William
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need help for beginner in scripting

Post by rednoah »

Not sure what's going on there.

* Make sure filebot is in the path or use the absolute path to the cmd.
* Make sure you call filebot.cmd, not filebot.exe (which calls filebot as windows gui application detached from the console)

With a normal install it'll look like this:

Code: Select all

C:\>filebot -script fn:suball "X:\Movies" --lang en -non-strict
Missing subtitles for 1 video files
Looking up subtitles by filehash via OpenSubtitles
Matched [Ten Inch Hero.mp4] to [devise-tih.cd2] via filehash
Fetching [devise-tih.cd2.txt]
Writing [devise-tih.cd2.txt] to [Ten Inch Hero.eng.txt]
:idea: Please read the FAQ and How to Request Help.
Post Reply