Page 1 of 1
Invalid usage: output folder must be separate from input arguments
Posted: 25 Oct 2020, 02:35
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..
Re: Scripting Help
Posted: 25 Oct 2020, 02:50
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:

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.
Re: Scripting Help
Posted: 25 Oct 2020, 15:20
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?
Re: Scripting Help
Posted: 25 Oct 2020, 15:30
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.

Here's how command-line arguments work:
viewtopic.php?t=1899
Re: Scripting Help
Posted: 25 Oct 2020, 16:04
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.
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.
Re: Scripting Help
Posted: 25 Oct 2020, 17:27
by rednoah
You
want to pass in this format:
You
are passing in this format:

Notice the difference caused by the command-line parser interpreting away your "..." double quotes
before filebot is even executed.
Re: Scripting Help
Posted: 28 Oct 2020, 05:12
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?
Re: Scripting Help
Posted: 28 Oct 2020, 05:42
by rednoah
Please read the
{plex} format manual:
rednoah wrote: ↑12 Sep 2016, 10:03
e.g.
Firefly/Season 01/Firefly - S01E01 - Serenity
e.g.
Re: Scripting Help
Posted: 28 Oct 2020, 14:13
by hakoreh
That's what I wasn't sure of, thank you