Some various automation questions

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
e64462
Posts: 5
Joined: 08 Jun 2013, 09:09

Some various automation questions

Post by e64462 »

Hi, this project looks really neat, but I can't tell based on the examples and what I've read in the forum if what I want to accomplish is possible.

1. I'd like to use filebot to do lookups and generate a formatted string without renaming any actual files, specifically something like:

show.sXXeXX.tags.tags.tags.extension -> generates -> Show (sXXeXX) "title"

so it will look up the title, put it in quotes, strip extension, etc. etc. I saw somewhere in the forums a mention of a match release function, but I can't find documentation about where to save script files and how to execute them. Even if I could only generate "show" and "title" and "sXXeXX" separately using filebot, I could probably glue them together using shell tools.

2. I'm not entirely sure how filebot does its lookups / matching, but for this question I'm more or less assuming that it's using thetvdb api. The tvdb allows u to access banners and poster artwork, and allows access to numerous other fields as well (network, airdate, etc. etc.) I'd like to grab and output some of these fields. The specific fields I'm interested in are:

"network" "poster" "imdb_id" "banner" "firstaired" "overview"

Is it at all possible to use filebot to scan / output these fields on an episode match?

Thanks for taking the time to read this, I appreciate your help! I'd be really interested in these features, and would be quite happy to support filebot if these features are supported!

Best
e6
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Some various automation questions

Post by rednoah »

1.
You can reuse parsing functions but that won't get u missing info like titles. You'll need to run rename and pass your own rename function that only collects the output information. Similar to --action test which simply does nothing.

2.
You'll need to look into htpc.groovy in details. How to run scripts isn't hard to figure out.
:idea: Please read the FAQ and How to Request Help.
e64462
Posts: 5
Joined: 08 Jun 2013, 09:09

Re: Some various automation questions

Post by e64462 »

Hi rednoah,

I've found:

http://sourceforge.net/p/filebot/code/H ... force=True

and I've been attempting to figure out how to write a simple script which prints the output of detectSeriesName()

My instinct is to create a file like "test.groovy" containing 1 line "println detectSeriesName($1)" and then to call it with "filebot -script test.groovy /path/to/files" but I don't understand how to pass CLI arguments to this script. I've looked around for info on the scripting language, but I just don't see it. Is there any documentation I can look at, or wisiwig?
e64462
Posts: 5
Joined: 08 Jun 2013, 09:09

Re: Some various automation questions

Post by e64462 »

Sorry, I should say that I've found http://groovy.codehaus.org/ but not any documentation on using groovy through torrentbot, in particular how to pass cli arguments through -script </path/to/script> to the internal functions.
e64462
Posts: 5
Joined: 08 Jun 2013, 09:09

Re: Some various automation questions

Post by e64462 »

I'm trying to look at http://filebot.net/scripts/artwork.tvdb.groovy to see how it handles arguments, but the comments are sparse and rather terse, there's really no way for a complete groovy noob to understand what's happening. Could you provide some simple examples to get me going?
e64462
Posts: 5
Joined: 08 Jun 2013, 09:09

Re: Some various automation questions

Post by e64462 »

i've gotten some small simple scripts to work. I'm wondering if there's a way to improve the artworkandnfo function for tv series. For some series (quite a few in fact) it requires user input when it's not confident about a match. Is there any way to force a match, i.e., always select the first array element? I would like to use this inside a much larger script that will operate on a headless server independent of any user interaction, but it throws an error without user input.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Some various automation questions

Post by rednoah »

With the artwork.* scripts you can just run it with -non-strict and I'll auto-select the most likely movie/series. On a headless machine this behaviour is default as it can't ask the users.

As for docs on vars:

args is list of cmdline file arguments, e.g. args.each{ println it }


You can pass any name=value pair via --def name=value ...
e.g. --def hello=42 and that'll define that variable to use in the script, e.g. println hello


And In my official scripts I often reuse standard filebot options:
_args contains the standard filebot options, e.g. _args.conflict
:idea: Please read the FAQ and How to Request Help.
Post Reply