AMC script with 4K folder

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Paldran
Posts: 2
Joined: 07 Jan 2018, 23:11

AMC script with 4K folder

Post by Paldran »

I am trying to figure out how to make the amc script create a separate folder just for 4k movies.

Here is my current movie format
MOVIE_FORMAT="Movies/{n.$QUOTE_FIXER} ({y}){'['+source+']'}/{n} ({y}) [{fn.match(/3D/)+', '}{vf}.{ac}-{channels}]"

I would like it to be another root folder called 4k, but if under movies there was a Folder that stored 4k movies, and another for any other resolution that would work fine as well.

This is all being ran on linux.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script with 4K folder

Post by rednoah »

Yep. Something like that will do the trick:

Code: Select all

{vf == /2160p/ ? '/path/to/Movies 4K' : '/other/path/to/Movies'}
:idea: Please read the FAQ and How to Request Help.
Aaron2104
Posts: 3
Joined: 07 Jul 2018, 10:52

Re: AMC script with 4K folder

Post by Aaron2104 »

rednoah wrote: 31 May 2018, 07:16 Yep. Something like that will do the trick:

Code: Select all

{vf == /2160p/ ? '/path/to/Movies 4K' : '/other/path/to/Movies'}
Hi Could you possibly show an exapmple of your script and not just this function of it as I'm having trouble adding this to my current script (sorry if this is a newbie question I've just been struggling to get this to work)

This is what I currently use and although basic it is sufficient for my needs apart from separating 4k movies from others.

Code: Select all

filebot -script fn:amc --output "U:/UTORRENT/Downloads/Completed/Filebot" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
Thanks in advance
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script with 4K folder

Post by rednoah »

You will need to pass in your own custom --def movieFormat. Please read the Change how files will be organized and renamed section of the amc script manual.

A prior understanding of how FileBot Format Expressions work will be helpful. I recommend using the Format Editor GUI first so you can get a bit of a feel for it.
:idea: Please read the FAQ and How to Request Help.
Aaron2104
Posts: 3
Joined: 07 Jul 2018, 10:52

Re: AMC script with 4K folder

Post by Aaron2104 »

Hi, I've used the editor and have the expressions working as I would like in the program itself but the problem I'm having is where to place them in the script as once I add them filebot cmd window opens as expected but immediately shuts,
Here's what I've tried:

Code: Select all

filebot -script fn:amc --output "U:/UTORRENT/Downloads/Completed/Filebot" --log-file amc.log --action copy --conflict auto -non-strict --def music=y subtitles=en "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def movieFormat={n.colon(' - ')} ({y}){' CD'+pi} {vf}-{hd} (Runtime-{minutes}) --def seriesFormat={n} - {s00e00} - {t} -  {vf}-{hd}

Code: Select all

filebot -script fn:amc --output "U:/UTORRENT/Downloads/Completed/Filebot" --log-file amc.log --action copy --conflict auto -non-strict --def music=y subtitles=en "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" movieFormat={n.colon(' - ')} ({y}){' CD'+pi} {vf}-{hd} (Runtime-{minutes}) seriesFormat={n} - {s00e00} - {t} -  {vf}-{hd}
I can live without filtering if the {vf} {hd} would work (It works in the program itself so I know its how I'm adding it to the script but any examples I can find only show how to create the expressions for one task and not complete script examples to show how each part works together.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script with 4K folder

Post by rednoah »

1.
Make sure to learn how to use filebot from the command-line first, and not just via utorrent, that way you can easily test and prototype, and the error messages you get when running bad commands will help you immensely to figure out what you did wrong.

2.
Please read Cmdline and Argument Passing. It's very important to have a general understanding how command-line arguments work, especially complex ones with spaces or quotes.

3.
Once you understand the problem, you can avoid the problem altogether, by using the @file syntax for reading command-line arguments from external text files.
:idea: Please read the FAQ and How to Request Help.
Aaron2104
Posts: 3
Joined: 07 Jul 2018, 10:52

Re: AMC script with 4K folder

Post by Aaron2104 »

Thanks for your help I'm almost there now (TV shows work, Movies needs further testing)
Also think I've fixed the annoying only works on files in folders error that seemed to come with the new Win10 store version of FB thanks to advice you gave another member so thanks for that too :)

This is what I'm testing now and seems ok so far but more testing is needed:

Code: Select all

filebot -script fn:amc --output "U:/UTORRENT/Filebot" --action copy --conflict override -non-strict --def music=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" "movieFormat=U:/UTORRENT/Filebot/movies/{n.colon(' - ')} ({y}){' CD'+pi} {vf}-{hd} (Runtime-{minutes})" "seriesFormat=U:/UTORRENT/Filebot/TV Shows/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t} - {vf}"
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script with 4K folder

Post by rednoah »

Your formats are fairly redundant. The following format will yields the same output paths:

Code: Select all

--def movieFormat="{plex} {vf}-{hd} (Runtime-{minutes})" seriesFormat="{plex} - {vf}"
:idea: Please read the FAQ and How to Request Help.
Post Reply