Invalid usage: output folder must be separate from input arguments

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
hakoreh
Posts: 5
Joined: 25 Oct 2020, 02:18

Invalid usage: output folder must be separate from input arguments

Post by hakoreh »

I'm new to the command line scene, usually I manually rename with Filebot.

I used this line in a script -

Code: Select all

filebot -script fn:amc --output "X:\Filebot" --action duplicate -non-strict "X:\Completed" --log-file amc.log --def excludeList=amc.txt
It worked well but I had to change the directory because even though the directory was different it still told me it wasn't. This is what I had previously

Code: Select all

filebot -script fn:amc --output "X:\Completed\Filebot" --action rename -non-strict "X:\Completed" --log-file amc.log --def excludeList=amc.txt
I want it to scan the Completed file and then rename and move all the files to Filebot folder (that is in the Completed folder, a subdirectory)

How can I accomplish this?

Secondly I have a TV folder that all my TV files go directly into - we'll call it TV and I want Filebot to go in and rename all the files and put the series in folders and I would run this script every couple hours or so. The problem is again it wants two different directories. I just really want it to rename it right where it is. I don't want to have to change my whole setup just to use Filebot from one directory to another.

Can Filebot rename the files and leave them where they are? I mean it does that when i do them manually..
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Scripting Help

Post by rednoah »

Input Folder X:\Completed includes Output Folder X:\Completed\Filebot which is a really bad idea for obvious reasons if you think about it. ;)

You must keep input / output separate:

Code: Select all

X:/Completed
X:/FileBot

:!: You cannot rename files right there. You'd end up processing the same files over and over and over in an infinite loop. If you were to rename files manually, that wouldn't be a problem.
:idea: Please read the FAQ and How to Request Help.
hakoreh
Posts: 5
Joined: 25 Oct 2020, 02:18

Re: Scripting Help

Post by hakoreh »

ok thanks

different question -- movieFormat={plex.derive{"[$af]"}} seriesFormat={plex.derive{"[$af]"}}
I am adding this to my options in CLI and the script runs fine but the data isn't added to the file name

Code: Select all

filebot -script fn:amc --output "X:\PLEX MAIN\Filebot" --action duplicate -non-strict "X:\Completed" --log-file amc.log --def excludeList=amc.txt movieFormat={plex.derive{"[$af]"}} seriesFormat={plex.derive{"[$af]"}}
I still get Supernatural - S15E16 - Drag Me Away as the file name without the af info

what am i doing wrong?
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Scripting Help

Post by rednoah »

Check the log. You're passing arguments incorrectly, passing in bad values. The log will show you the values that you are passing in, as opposed to the values that you think you're passing in.


:idea: Here's how command-line arguments work:
viewtopic.php?t=1899
:idea: Please read the FAQ and How to Request Help.
hakoreh
Posts: 5
Joined: 25 Oct 2020, 02:18

Re: Scripting Help

Post by hakoreh »

I dont follow. I see in the log (and while it runs)

here's the updated script

Code: Select all

 filebot -script fn:amc --output "X:\PLEX MAIN\Filebot" --action duplicate -non-strict "X:\Completed" --log-file amc.log --def excludeList=amc.txt movieFormat={plex.derive{" [$af]"}} seriesFormat={plex.derive{" [$af]"}}
here are the log parameters
Run script [fn:amc] at [Sun Oct 25 11:43:47 EDT 2020]
Parameter: excludeList = amc.txt
Parameter: movieFormat = {plex.derive{[$af]}}
Parameter: seriesFormat = {plex.derive{[$af]}}

I still don't get the af in the file name

I'm using this post as an example
rednoah wrote: 08 May 2019, 15:00 Just using @files and avoiding any kind of complexity on the command-line is a good idea though.

Code: Select all

filebot @X:/args.txt
cat args.txt

Code: Select all

-script
fn:amc
--output
Y:\Downloads\ftp\TEST\Organized Media
--action
duplicate
-non-strict
Y:\Downloads\ftp\TEST\NEW
--log-file
amc.log
--lang
de
--def
excludeList=amc.txt
clean=y
--def
movieFormat={plex.derive{" [$vc]"}}
seriesFormat={plex.derive{" [$vc]"}}
animeFormat={plex.derive{" [$vc]"}}
Now you don't have to know how command-line argument parsing works. It's just one argument per line. Easy. :ugeek:
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Scripting Help

Post by rednoah »

You want to pass in this format:

Code: Select all

{plex.derive{" [$af]"}}
You are passing in this format:

Code: Select all

{plex.derive{[$af]}}
:!: Notice the difference caused by the command-line parser interpreting away your "..." double quotes before filebot is even executed.
:idea: Please read the FAQ and How to Request Help.
hakoreh
Posts: 5
Joined: 25 Oct 2020, 02:18

Re: Scripting Help

Post by hakoreh »

I figured it all out, thank you and its working now. One more step. I am going to tell FB that what type of file its trying to rename, as in movies or TV, therefore when it moves the file to the output, i dont want it to create a movies folder and then put the renamed files there, i just want it to dump it into the directory i specify.

how can i do this?
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Scripting Help

Post by rednoah »

Please read the {plex} format manual:
rednoah wrote: 12 Sep 2016, 10:03 e.g. Firefly/Season 01/Firefly - S01E01 - Serenity

Code: Select all

{plex.tail}
e.g.

Code: Select all

{plex.derive{" [$af]"}.tail}
:idea: Please read the FAQ and How to Request Help.
hakoreh
Posts: 5
Joined: 25 Oct 2020, 02:18

Re: Scripting Help

Post by hakoreh »

Code: Select all

{plex.derive{" [$af]"}.tail}

That's what I wasn't sure of, thank you
Post Reply