Windows amc script not working need some help please

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Windows amc script not working need some help please

Post by x5rl »

Can't get it work comes up with errors this is the script I am trying to use

Code: Select all

filebot -script fn:amc "E:\Leeching Done\Radarr\" --output "E:\Videos\" ... --def movieFormat="{genres =~ \Anime|Animated|Cartoon|Animation\ ? 'Animated' :genres =~ \Documentary\ ? 'Documentaries' : 'Films'}\{ny}\{ny} --def ut_label=Movie"
This is the error I am getting.

Code: Select all

C:\Windows\system32>filebot -script fn:amc "E:/Leeching Done/radarr/" --output "E:/Videos" ... --def movieFormat="{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny} --def ut_label=Movie"
File does not exist: E:/Leeching Done/radarr/
Run script [fn:amc] at [Thu May 27 12:39:29 BST 2021]
Parameter: movieFormat = {genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny} --def ut_label=Movie
Argument[0]: C:\Windows\System32
Invalid usage: output folder must exist and must be a directory: E:\Videos
Abort (×_×)
The folders do indeed exist?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

:idea: Please read Cmdline and Argument Passing for details.


:idea: Use the @file syntax for reading command-line arguments from external text files.


1.
BAD:

Code: Select all

--output "E:\Videos\"
GOOD:

Code: Select all

--output "E:\Videos"
Image


2.
You forgot the ..." end quote for your begin "... quote so everything goes awry from there:

Code: Select all

Parameter: movieFormat = {genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny} --def ut_label=Movie

3.
According to the operating system, E:\Videos is not an existing directory, perhaps because it doesn't exist, perhaps because of permissions, could be anything, try with different folders to see what works and what doesn't work and then take it from there:

Code: Select all

Invalid usage: output folder must exist and must be a directory: E:\Videos
:idea: Please read the FAQ and How to Request Help.
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Re: Windows amc script not working need some help please

Post by x5rl »

rednoah wrote: 27 May 2021, 12:24 BAD:

Code: Select all

--output "E:\Videos\"
GOOD:

Code: Select all

--output "E:\Videos"
Image

:idea: Please read Cmdline and Argument Passing for details.

:idea: Use the @file syntax for reading command-line arguments from external text files.
Thanks I removed the backslash but get a even bigger error which never seems to stop here is part of it

Code: Select all

C:\Windows\system32>filebot -script fn:amc "E:\Leeching Done\Radarr" --output "E:\Videos" ... --def movieFormat="{genres =~ \Anime|Animated|Cartoon|Animation\ ? 'Animated' :genres =~ \Documentary\ ? 'Documentaries' : 'Films'}\{ny}\{ny} --def ut_label=Movie"
Run script [fn:amc] at [Thu May 27 13:27:30 BST 2021]
Parameter: movieFormat = {genres =~ \Anime|Animated|Cartoon|Animation\ ? 'Animated' :genres =~ \Documentary\ ? 'Documentaries' : 'Films'}\{ny}\{ny} --def ut_label=Movie
Argument[0]: E:\Leeching Done\Radarr
Argument[1]: C:\Windows\System32
Ignore hidden: C:\Windows\System32\GroupPolicy
Ignore hidden: C:\Windows\System32\config\BBI.LOG1
Ignore hidden: C:\Windows\System32\config\BBI.LOG2
Ignore hidden: C:\Windows\System32\config\BBI{53b39ea0-18c4-11ea-a811-000d3aa4692b}.TM.blf
Ignore hidden: C:\Windows\System32\config\BBI{53b39ea0-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000001.regtrans-ms
Ignore hidden: C:\Windows\System32\config\BBI{53b39ea0-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000002.regtrans-ms
Ignore hidden: C:\Windows\System32\config\BCD-Template.LOG
Ignore hidden: C:\Windows\System32\config\BCD-Template.LOG1
Ignore hidden: C:\Windows\System32\config\BCD-Template.LOG2
Ignore hidden: C:\Windows\System32\config\COMPONENTS.LOG1
Ignore hidden: C:\Windows\System32\config\COMPONENTS.LOG2
Ignore hidden: C:\Windows\System32\config\COMPONENTS{53b39e63-18c4-11ea-a811-000d3aa4692b}.TM.blf
Ignore hidden: C:\Windows\System32\config\COMPONENTS{53b39e63-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000001.regtrans-ms
Ignore hidden: C:\Windows\System32\config\COMPONENTS{53b39e63-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000002.regtrans-ms
Ignore hidden: C:\Windows\System32\config\DEFAULT.LOG1
Ignore hidden: C:\Windows\System32\config\DEFAULT.LOG2
Ignore hidden: C:\Windows\System32\config\DRIVERS.LOG1
Ignore hidden: C:\Windows\System32\config\DRIVERS.LOG2
Ignore hidden: C:\Windows\System32\config\DRIVERS{53b39e70-18c4-11ea-a811-000d3aa4692b}.TM.blf
Ignore hidden: C:\Windows\System32\config\DRIVERS{53b39e70-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000001.regtrans-ms
Ignore hidden: C:\Windows\System32\config\DRIVERS{53b39e70-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000002.regtrans-ms
Ignore hidden: C:\Windows\System32\config\ELAM.LOG1
Ignore hidden: C:\Windows\System32\config\ELAM.LOG2
Ignore hidden: C:\Windows\System32\config\SAM.LOG1
Ignore hidden: C:\Windows\System32\config\SAM.LOG2
Ignore hidden: C:\Windows\System32\config\SECURITY.LOG1
Ignore hidden: C:\Windows\System32\config\SECURITY.LOG2
Ignore hidden: C:\Windows\System32\config\SOFTWARE.LOG1
Ignore hidden: C:\Windows\System32\config\SOFTWARE.LOG2
Ignore hidden: C:\Windows\System32\config\SYSTEM.LOG1
Ignore hidden: C:\Windows\System32\config\SYSTEM.LOG2
Ignore orphaned subtitles: C:\Windows\System32\config\systemprofile\AppData\Local\D3DSCache\5adbeda69f8554f3\F4EB2D6C-ED2B-4BDD-AD9D-F913287E6768.idx
Ignore orphaned subtitles: C:\Windows\System32\config\systemprofile\AppData\Local\D3DSCache\90ccb9cba3f45768\F4EB2D6C-ED2B-4BDD-AD9D-F913287E6768.idx
Ignore orphaned subtitles: C:\Windows\System32\config\systemprofile\AppData\Local\D3DSCache\f9156d1136660b11\F4EB2D6C-ED2B-4BDD-AD9D-F913287E6768.idx
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Credentials\DFBE70A7E5CC19A398EBF1B96859CE5D
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCookies
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\CloudAPCache\MicrosoftAccount\2255f3d1f04a51da5e8f57958b221aedf84f85446ce7615ebbd02c2386cf81a4\Cache\CacheData
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\History\History.IE5
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\Content.IE5
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\IE
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\Notifications\WPNPRMRY.tmp
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Packages\microsoft.windows.fontdrvhost\AC\INetCache
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Packages\microsoft.windows.fontdrvhost\AC\INetCookies
Ignore hidden: C:\Windows\System32\config\systemprofile\AppData\Local\Packages\microsoft.windows.fontdrvhost\AC\INetHistory
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3d-18c4-11ea-a811-000d3aa4692b}.TxR.0.regtrans-ms
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3d-18c4-11ea-a811-000d3aa4692b}.TxR.1.regtrans-ms
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3d-18c4-11ea-a811-000d3aa4692b}.TxR.2.regtrans-ms
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3d-18c4-11ea-a811-000d3aa4692b}.TxR.3.regtrans-ms
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3d-18c4-11ea-a811-000d3aa4692b}.TxR.4.regtrans-ms
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3d-18c4-11ea-a811-000d3aa4692b}.TxR.blf
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3e-18c4-11ea-a811-000d3aa4692b}.TM.blf
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3e-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000001.regtrans-ms
Ignore hidden: C:\Windows\System32\config\TxR\{53b39e3e-18c4-11ea-a811-000d3aa4692b}.TMContainer00000000000000000002.regtrans-ms
Ignore system path: C:\Windows\System32\drivers\etc
Ignore hidden: C:\Windows\System32\drivers\Msft_User_WpdFs_01_11_00.Wdf
^C
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

You have multiple errors in your command-line so I updated my previous post:
viewtopic.php?p=54721#p54721


:arrow: Long story short. Use @files to elegantly bypass all of these potential pitfalls.
:idea: Please read the FAQ and How to Request Help.
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Re: Windows amc script not working need some help please

Post by x5rl »

rednoah wrote: 27 May 2021, 12:33 You have multiple errors in your command-line so I updated my previous post:
viewtopic.php?p=54721#p54721


:arrow: Long story short. Use @files to elegantly bypass all of these potential pitfalls.
How do you do it? learning all this is so confussing I thought when I bought filebot it would be easy (well the gui is tho!)

So I need to put all the code in a txt file and use filebot to call that txt file?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

Yes, you simplify the command to the point where you don't need to quote or escape anything, elegantly eliminating all possible errors that stem from not quoting or escaping arguments correctly. Figuring out how to correctly quote and escape complex arguments is not humanly possible, and varies by shell and operating system, so I'd recommend side-stepping the problem altogether.

e.g.

Code: Select all

filebot @C:/filebot.args.txt
rednoah wrote: 07 Dec 2015, 07:17 e.g. @file usage

Code: Select all

filebot @/path/to/args.txt
e.g. /path/to/args.txt

Code: Select all

-script
fn:amc
/input
--output
/output
--def
movieFormat=Movies/{ny}/{fn}
seriesFormat=TV/{n}/{'S'+s}/{fn}
animeFormat=Anime/{n}/{fn}
:idea: Please read the FAQ and How to Request Help.
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Re: Windows amc script not working need some help please

Post by x5rl »

rednoah wrote: 27 May 2021, 13:50 Yes, you simplify the command to the point where you don't need to quote or escape anything, elegantly eliminating all possible errors that stem from not quoting or escaping arguments correctly. Figuring out how to correctly quote and escape complex arguments is not humanly possible, and varies by shell and operating system, so I'd recommend side-stepping the problem altogether.

e.g.

Code: Select all

filebot @C:/filebot.args.txt
rednoah wrote: 07 Dec 2015, 07:17 e.g. @file usage

Code: Select all

filebot @/path/to/args.txt
e.g. /path/to/args.txt

Code: Select all

-script
fn:amc
/input
--output
/output
--def
movieFormat=Movies/{ny}/{fn}
seriesFormat=TV/{n}/{'S'+s}/{fn}
animeFormat=Anime/{n}/{fn}
Thanks for that so ive got this so far

Code: Select all

-script
fn:amc
E:/Leeching Done/Radarr
--output
E:/Videos
--def
movieFormat=Movies/{ny}/{fn}
seriesFormat=TV/{n}/{'S'+s}/{fn}
animeFormat=Anime/{n}/{fn}
how would I split the movies part into 3 genres

Code: Select all

{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
as I have 3 main folders Animated, Documentaries and Films (basicly the rest)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

1.
Prototype your custom format in the Format Editor GUI until you're happy.


2.
Copy and paste your custom format into your @file verbatim as shown in the example:

Code: Select all

movieFormat={genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
:!: The format must be a single line.
:idea: Please read the FAQ and How to Request Help.
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Re: Windows amc script not working need some help please

Post by x5rl »

rednoah wrote: 27 May 2021, 15:05 1.
Prototype your custom format in the Format Editor GUI until you're happy.


2.
Copy and paste your custom format into your @file verbatim as shown in the example:

Code: Select all

movieFormat={genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
:!: The format must be a single line.
Like this?

Code: Select all

-script
fn:amc
E:/Leeching Done/Radarr
--output
E:/Videos
--def
movieFormat=Movies/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
seriesFormat=TV/{n}/{'S'+s}/{fn}
animeFormat=Anime/{n}/{fn}

or does each one have to be on a single line?

it works in the GUI


Does this look okay to you?

Code: Select all

C:\Windows\system32>filebot @C:\Filebot\runme.txt
Run script [fn:amc] at [Thu May 27 17:08:04 BST 2021]
Parameter: movieFormat = Movies/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
Parameter: seriesFormat = TV/{n}/{'S'+s}/{fn}
Parameter: animeFormat = Anime/{n}/{fn}
Argument[0]: E:\Leeching Done\Radarr
Input: E:\Leeching Done\Radarr\M(2021) [1080p] [WEBRip] [5.1] [YTS.MX]\M.2021.1080p.WEBRip.x264.AAC5.1-[YTS.MX].mp4
Group: {Movie=M (2021)} => [M2021.1080p.WEBRip.x264.AAC5.1-[YTS.MX].mp4]
Rename movies using [TheMovieDB]
Auto-detect movie from context [E:\Leeching Done\Radarr\M (2021) [1080p] [WEBRip] [5.1] [YTS.MX]\M.2021.1080p.WEBRip.x264.AAC5.1-[YTS.MX].mp4]
Activate License [P21548106] on [Thu May 27 17:08:13 BST 2021]
[MOVE] from [E:\Leeching Done\Radarr\M (2021) [1080p] [WEBRip] [5.1] [YTS.MX]\M.2021.1080p.WEBRip.x264.AAC5.1-[YTS.MX].mp4] to [E:\Videos\Movies\Films\Mo (2021)\M (2021).mp4]
Processed 1 file
Done ?(?????)?

C:\Windows\system32>
edit = to clean up files would I just add --def clean=y onto the end of the txt?

Thanks again
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

In your @file there is 1 line per 1 argument. It's that simple.


This is 2 arguments:

Code: Select all

--def clean=y
:idea: Please read Cmdline and Argument Passing for details.


So you paste 2 lines into your @file like so:

Code: Select all

--def
clean=y

Also, you probably wanna use the {plex} format for all your TV Series and Anime episodes:

Code: Select all

--def
seriesFormat={plex}
animeFormat={plex}
:idea: Please read the FAQ and How to Request Help.
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Re: Windows amc script not working need some help please

Post by x5rl »

rednoah wrote: 27 May 2021, 16:27 In your @file there is 1 line per 1 argument. It's that simple.


This is 2 arguments:

Code: Select all

--def clean=y
:idea: Please read Cmdline and Argument Passing for details.


So you paste 2 lines into your @file like so:

Code: Select all

--def
clean=y

Also, you probably wanna use the {plex} format for all your TV Series and Anime episodes:

Code: Select all

--def
seriesFormat={plex}
animeFormat={plex}
Fantastic it works many thanks
my last question ive been reading your viewtopic.php?p=9774#p9774 about qbittorent running the script after torrent has finished.

would I just add

Code: Select all

filebot @C:\Filebot\runme.txt
(which is where the file is)

If so its doesn't seem to be working
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

If you're writing a command template for qBT, then you need to add the qBT variables to the command-line so that qBT can replace them with actual values:

Code: Select all

filebot @C:\amc.args --def "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"
:idea: Please read the FAQ and How to Request Help.
x5rl
Posts: 7
Joined: 27 May 2021, 11:43

Re: Windows amc script not working need some help please

Post by x5rl »

rednoah wrote: 27 May 2021, 18:03 If you're writing a command template for qBT, then you need to add the qBT variables to the command-line so that qBT can replace them with actual values:

Code: Select all

filebot @C:\amc.args --def "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"
So now after all that I have to change that file to work with qbittorrent meh I give up thanks for the help tho!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

x5rl wrote: 27 May 2021, 21:12 So now after all that I have to change that file to work with qbittorrent meh I give up thanks for the help tho!
@files allow you to move your command-line arguments from the command-line into dedicated text files. There's nothing specific about qBT there, so there's nothing you can change to make qBT work, or not work. So not sure what you mean there.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Windows amc script not working need some help please

Post by rednoah »

lisukovigor492 wrote: 31 May 2021, 12:44 thanks for explaining, that is, qBT is not configurable and cannot be changed in any way? right?
What exactly would you want to configure or change in qBT? 🤔 qBT 3rd party integration is easy and flexible, so there's no issues there as far as FileBot integration is concerned.
:idea: Please read the FAQ and How to Request Help.
Post Reply