Is there a way to force filebot to search TV series or movie

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Is there a way to force filebot to search TV series or movie

Post by nzdreamer55 »

Hi Rednoah,

I have created a little bat to run the utorrent script and I would like to add something to the command line to tell file bot that I want to search tv series instead of movies or music. I know that filebot is smart and figures it out most of the time, but I would like to be able to tell it not to worry about the movies and music and just focus on tv series. Can I do this with a switch?

Code: Select all

set /P folder=Enter folder name:
filebot -script fn:configure -script fn:amc "%folder%" --def "seriesFormat={[\"\\\\TITANSERVER/4media.2tb/TV Shows 2\",\"\\\\TITANSERVER/3media.2tb/TV Shows 1\",\"\\\\TITANSERVER/1media.3tb/TV Shows 3\"].collect{\"$it/$n\" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}\{n} {episode.special ? 'Special' : 'Season '+s.pad(2)}\{n}.{s00e00}{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}.{t}" -r --action copy --conflict override -non-strict --def subtitles=en --def myepisodes=nzdreamer55:XXXXXX --def clean=n
Thanks
-S
User avatar
rednoah
The Source
Posts: 23935
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a way to force filebot to search TV series or m

Post by rednoah »

So you mean you know that you're processing tv shows and you wanna force filebot to handle everything as tv show?

The label parameter can be used to force the desired behaviour:

Code: Select all

--def ut_label=tv
:idea: Please read the FAQ and How to Request Help.
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Re: Is there a way to force filebot to search TV series or m

Post by nzdreamer55 »

That is what I am looking for! Thanks
-S
User avatar
rednoah
The Source
Posts: 23935
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a way to force filebot to search TV series or m

Post by rednoah »

Since you're asking the use for input I assume you wanna create a reusable script that you can call. I recommend instead of doing <ask user set folder> %folder% to do %* (means pass through all arguments). That way you'd be able to call myscript.cmd path/to/files. And more cool you can just drop files on the bat/cmd file and cmd would automatically start and pass those files as arguments. They call it droplets on Mac.
:idea: Please read the FAQ and How to Request Help.
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Re: Is there a way to force filebot to search TV series or m

Post by nzdreamer55 »

Thanks! I'll give it a try! :-)
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Re: Is there a way to force filebot to search TV series or m

Post by nzdreamer55 »

That is so SUPER COOL! Thanks for the tip.
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Re: Is there a way to force filebot to search TV series or m

Post by nzdreamer55 »

Well I spoke too soon. I got it to work for TV series, but it does not want to work when I drag a movie on to it.

The works (tv)

Code: Select all

set /P media=Enter media type (tv,movies):
filebot -script fn:configure -script fn:amc "%*" --def "seriesFormat={[\"\\\\TITANSERVER/4media.2tb/TV Shows 2\",\"\\\\TITANSERVER/3media.2tb/TV Shows 1\",\"\\\\TITANSERVER/1media.3tb/TV Shows 3\"].collect{\"$it/$n\" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}\{n} {episode.special ? 'Special' : 'Season '+s.pad(2)}\{n}.{s00e00}{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}.{t}" --def ut_label=%media% -r --action copy --conflict override -non-strict --def subtitles=en --def myepisodes=nzdreamer55:<Removed> --def clean=y
This does not (movie)

Code: Select all

filebot -script fn:configure -script fn:amc "%*" --def "movieFormat={[\"\\\\TITANSERVER/5media.3tb/Movie 2\",\"\\\\TITANSERVER/2media.2tb/Movies 1\"].collect{\"$it\" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}/{n} ({y}) [{imdbid}]/{n} ({y}) [{imdbid}]{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}" -r --action copy --conflict override -non-strict --def subtitles=en --def myepisodes=nzdreamer55:<Remove> --def clean=y
P.S. Thanks for getting my password from my first post, I just forgot to do that.

If I put in a file path for the movie and run it at the CMD then it works. Not sure why it does not pass the argument to filebot. The CMD window closes too fast for me to read the error. Maybe I should try to output to a file?
-S
User avatar
rednoah
The Source
Posts: 23935
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a way to force filebot to search TV series or m

Post by rednoah »

1. -script fn:configure -script fn:amc??? Even I can only guess. Probably only only executing fn:amc.
2. "%*" => How come u double quote this when I don't??? I guess it's passing in ""/path/to/files""
3. The movie droplet is missing the --def ut_label=movie

"The cmd window closes to fast" is a bad excuse :P You can just open cmd, call your script from cmdline and just pass in a path. It won't close.
:idea: Please read the FAQ and How to Request Help.
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Re: Is there a way to force filebot to search TV series or m

Post by nzdreamer55 »

Thanks rednoah,

Not sure what happened with the first problem you listed. I cleaned this up and it still works.

The %* isn't passing UNC paths correctly and I cannot figure out why.

Can you tell me how to pass in a path to an opened cmd window? I changed the double quotes to single.

Here is the code I am working with

Code: Select all

filebot -script fn:amc '%*' --def "movieFormat={[\"\\\\TITANSERVER/5media.3tb/Movie 2\",\"\\\\TITANSERVER/2media.2tb/Movies 1\"].collect{\"$it\" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}/{n} ({y}) [{imdbid}]/{n} ({y}) [{imdbid}]{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}" --def "seriesFormat={[\"\\\\TITANSERVER/4media.2tb/TV Shows 2\",\"\\\\TITANSERVER/3media.2tb/TV Shows 1\",\"\\\\TITANSERVER/1media.3tb/TV Shows 3\"].collect{\"$it/$n\" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}\{n} {episode.special ? 'Special' : 'Season '+s.pad(2)}\{n}.{s00e00}{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}.{t}" -r --action copy --conflict override -non-strict --def subtitles=en --def myepisodes=nzdreamer55:XXXXX--def clean=y  >> "G:\Public.Commons\Filebotoutput\filebot.log" 2>&1
Here is the output showing that the unc path does not get passed correctly.
Parameter: movieFormat = {["\\\\TITANSERVER/5media.3tb/Movie 2","\\\\TITANSERVER/2media.2tb/Movies 1"].collect{"$it" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}/{n} ({y}) [{imdbid}]/{n} ({y}) [{imdbid}]{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}
Parameter: seriesFormat = {["\\\\TITANSERVER/4media.2tb/TV Shows 2","\\\\TITANSERVER/3media.2tb/TV Shows 1","\\\\TITANSERVER/1media.3tb/TV Shows 3"].collect{"$it/$n" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.listPath().reverse().findResult{ it.freeSpace ?: null } <=> b.listPath().reverse().findResult{ it.freeSpace ?: null } }.last()}\{n} {episode.special ? 'Special' : 'Season '+s.pad(2)}\{n}.{s00e00}{'.'+[vf]}{'.'+[resolution]}{'.'+[vc]}{'.'+[ac]}{'.'+[af]}{'.'+[source]}.{t}
Parameter: subtitles = en
Parameter: myepisodes = nzdreamer55:XXXX
Parameter: clean = y
Argument: C:\Windows\'\TITANSERVER\5media.3tb\Movie 2\Ride with the Devil (1999)'
Exception: File not found: C:\Windows\'\TITANSERVER\5media.3tb\Movie 2\Ride with the Devil (1999)'
java.lang.Exception: File not found: C:\Windows\'\TITANSERVER\5media.3tb\Movie 2\Ride with the Devil (1999)'
at Script3$_run_closure4.doCall(Script3.groovy:8)
at Script3.run(Script3.groovy:8)
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 (°_°)
As always thank you for your help and time.
-S
User avatar
rednoah
The Source
Posts: 23935
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a way to force filebot to search TV series or m

Post by rednoah »

Erm, I didn't use double quotes. If look carefully Neither did i use single quotes. It's not that you can pass in a UNC path, it's that you pass in an extra quote as path.


Isn't this completely obvious by looking at the error message???

java.lang.Exception: File not found: C:\Windows\'\TITANSERVER\5media.3tb\Movie 2\Ride with the Devil (1999)'
:idea: Please read the FAQ and How to Request Help.
nzdreamer55
Posts: 168
Joined: 20 Jul 2012, 23:25

Re: Is there a way to force filebot to search TV series or m

Post by nzdreamer55 »

Oh I see. I was working from the description of the utorrent script where it says
Standalone Usage
You can use the script directly from the cmdline like this, by just adding files as arguments instead of the utorrent parameters.
CODE: SELECT ALL
filebot -script fn:amc "/path/to/input/" --output "X:/path/to/output" --action copy --conflict skip -non-strict
Since the
"/path/to/input/"
has quotes I just took the %* and put it between the quotes. Does this seem strange reasoning?

Thanks so much for the help, I realize that it is hard for you to see that other people don't see code the way you do. I am glad you are willing to help me. Thanks again.
-S
User avatar
rednoah
The Source
Posts: 23935
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a way to force filebot to search TV series or m

Post by rednoah »

You're reasoning is fine, could have been one way or the other. On unix bash "$@" is equivalent to windows cmd %*. The point is just trying and finding out what does work, if it doesn't look at the output, trying again, repeat until it works. I do the same for each and any of your questions. :P

%* => means all arguments (e.g. "path1" "path2") so it has to take care of quoting things properly
:idea: Please read the FAQ and How to Request Help.
Post Reply