Board index Scripting and Automation How Do I use scripts?

How Do I use scripts?

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc

Post 12 Jul 2012, 22:36

Posts: 13
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.

Post 13 Jul 2012, 08:24
rednoah User avatar
The Source

Posts: 2081
Location: 北京

1. Open up the cmdline.
Image

2. Run a command.
filebot -version


For sortivo it would be something like:
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:
=> viewtopic.php?f=8&t=160
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 13 Jul 2012, 12:27

Posts: 13
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 ?

Post 13 Jul 2012, 14:05
rednoah User avatar
The Source

Posts: 2081
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 13 Jul 2012, 14:43

Posts: 13
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.

Post 13 Jul 2012, 15:03
rednoah User avatar
The Source

Posts: 2081
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 13 Jul 2012, 15:22

Posts: 13
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 ?

Post 13 Jul 2012, 15:36
rednoah User avatar
The Source

Posts: 2081
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 13 Jul 2012, 15:51

Posts: 13
How Do I the costume script ?

Post 13 Jul 2012, 16:07
rednoah User avatar
The Source

Posts: 2081
Location: 北京

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
filebot -script C:/path/to/script.groovy ...
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 13 Jul 2012, 22:26

Posts: 13
I'll get back to modifying the script later.

Using this command:
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.

Post 14 Jul 2012, 03:15
rednoah User avatar
The Source

Posts: 2081
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 14 Jul 2012, 03:59
rednoah User avatar
The Source

Posts: 2081
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 14 Jul 2012, 11:12

Posts: 13
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:
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"

Post 15 Jul 2012, 00:35

Posts: 13
My bad, everything works.


Return to Scripting and Automation

cron