How Do I use scripts?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

How Do I use scripts?

Post by yup8 »

I'm using FileBot for a while.
I have heard about scripts.
I found this script:
"filebot -script fn:sortivo -trust-script <folder> [-non-strict] [--output path/to/folder]"
And I would like to use it.
I have a Folder with Tv Episodes and movies, and I want them renamed and moved to my external Hard-Drive.
Is that the correct Script?
How Exactly Do I use it ?
Thanks.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

1. Open up the cmdline.
Image

2. Run a command.

Code: Select all

filebot -version
For sortivo it would be something like:

Code: Select all

filebot -script fn:sortivo -trust-script "D:/tivo/recordings" -non-strict --output "D:/Organized Media/"

This is probably not what you're looking for. This is for people that download or record movies or tv shows, more or less well-named, and want things sorted out everyday. The script only runs once but with task scheduler or other tools you can automate things.

* If wanna throw your entire completely messed up collection you're welcome to try, but don't expect a magic hammer. :P

** I think you might be looking for something like this? But the very nature of a script like this is to be only used once, plus it's really not so easy, so nobody is gonna bother with actually making it work:
=> http://filebot.sourceforge.net/forums/v ... ?f=8&t=160
:idea: Please read the FAQ and How to Request Help.
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

Yes, I download well named Tv Episdoes and movies, And I want them moved to my Streamer and orginized there.
I ran a test on my pc.
Results here:
http://pastebin.com/kf0wMteS
Long story short, It failed.
Why ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

Network error when cross-referencing something with TMDb. Should work if you try again.

Wouldn't something like the utorrent-postprocess script be better for that? The sortivo script was originally designed more for tivo recordings. Anyway, updated the sortivo script you're using with lots of stuff I developed for utorrent-postprocess. It's online, run filebot -clear to make sure you get the latest script.
:idea: Please read the FAQ and How to Request Help.
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

Ok, So my files are at
"C:\Users\Mattan\Downloads\Seeding\Media"
I want to move them to my Streamer, Means I have to set the output to P:\ (My Streamer Is a mapped drive in my PC)
Then It will copy the files there, Organized to movies and TV shows, and they will be sorted.
Correct?
A few questions
1.Does the original files stay In my C:\ Drive For me to continue and seed them ?
2.About the subtitle downloading, where can I determine the language of the subtitles ?
3.What are exactly the .nfo files?
4.How do I cancel "Fetch Artwork" Option ?,my Streamer does that automatically.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

1. Yes, via --action copy

2. sortivo doesn't do that, utorrent-postprocess does. Set language via --lang en/de/etc. But that'll set TMDB and TVDB language prefs. You can set things specifically in the script.

3. Google it. :P Usually contains imdb id and extra meta data about the movie / tv series.

4. Create your own modded version of the script. You'll just need to delete a few lines.
:idea: Please read the FAQ and How to Request Help.
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

To be honest, I don't know what lines to remove, and I have read through the whole code.
What does exactly fetch artwork does? My streamer just downloads the artworks and displays in nicely. What does this script does?

About the language, just add --lang he after "--conflict skip" when running the script ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

1. Yep, can add that option at any position.

2. Just downloads artwork and banners from TheTVDB and saves it according to XBMC filename conventions. In the script there is printlns "Fetching artwork for...". That's where where the artwork code starts. Just delete that whole block.
:idea: Please read the FAQ and How to Request Help.
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

How Do I the costume script ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

1. Download from here:
http://filebot.sourceforge.net/scripts/

2. Edit using a proper code editor like notepad++ or notepad2. (DO NOT USE EDITOR)
http://notepad-plus-plus.org/

3. Run local script

Code: Select all

filebot -script C:/path/to/script.groovy ...
:idea: Please read the FAQ and How to Request Help.
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

I'll get back to modifying the script later.

Using this command:

Code: Select all

filebot -script fn:utorrent-postprocess "C:\Users\Mattan\Downloads\Seeding\Media" --output "C:\Users\Mattan\Downloads\Seeding\output" --action copy --conflict skip -non-strict -trust-script -Xxbmc=localhost"
getting this in the cmd: http://pastebin.com/DU9SyfZh (although it wont log the whole operation)

The Input: 2 seasons of a TV series named "iCarly" (For my kids), And one movie named "The Avengers" (For me)
The Output: One movie folder with "The Avengers" Files only.
Where is my output of iCarly?
Last edited by yup8 on 14 Jul 2012, 11:13, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

You didn't use that cmd here but added --lang iw somewhere. Apparently it can't fetch episodes data in hebrew. Since it didn't get any episode data it didn't rename/move anything.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How Do I use scripts?

Post by rednoah »

There's an incompatibility with language codes between Java and what TheTVDB uses. So Hebrew and Russian is broken for the TheTVDB plugin right now.
:idea: Please read the FAQ and How to Request Help.
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

Ok Nvm It worked.
I will now go to modifying the script to my own needs.
-No subtitle downloading
-No .nfo creating
-No Artwork Downloading

Update1:
-This is The modified script I created.
http://pastebin.com/ea3feR7b
Just Deleted a bunch of stuff, not sure if the right stuff tough
It fails. Take a look at the log:

Code: Select all

C:\Users\Mattan>filebot -script C:\Users\Mattan\Desktop\utorrent-postprocess1.gr
oovy "C:\Users\Mattan\Downloads\Seeding\Media" --output "C:\Users\Mattan\Downloa
ds\Seeding\output" --action copy --conflict skip -non-strict -trust-script -Xxbm
c=localhost"
Parameter: xbmc = localhost
Input: C:\Users\Mattan\Downloads\Seeding\Media\ICarly.S01.DVD-TVRip.XviD\ICarly.
S01E01.DVDRip.XviD-OSiTV.avi
..........-Some Actions-........
[COPY] Rename [C:\Users\Mattan\Downloads\Seeding\Media\ICarly.S01.DVD-TVRip.XviD
\ICarly.S01E25.DVDRip.XviD-OSiTV.avi] to [C:\Users\Mattan\Downloads\Seeding\outp
ut\TV Shows\iCarly\Season 1\iCarly - S01E25 - iHave a Lovesick Teacher.avi]
Processed 25 files
MissingPropertyException: No such property: options for class: Script3
groovy.lang.MissingPropertyException: No such property: options for class: Scrip
t3
        at Script3$_run_closure6.doCall(Script3.groovy:73)
        at Script3.run(Script3.groovy:64)
        at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
        at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
        at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)

        at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (░_░)

Update2:
After I talked with the awesome rednoah he wrote an updated script for me, here:
http://pastebin.com/F95ATKLE "utorrent simple"
yup8
Posts: 13
Joined: 12 Jul 2012, 22:34

Re: How Do I use scripts?

Post by yup8 »

My bad, everything works.
Post Reply