How to to pass --def name=value script parameters on the command-line?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Tanyac
Posts: 20
Joined: 17 Nov 2014, 05:28

How to to pass --def name=value script parameters on the command-line?

Post by Tanyac »

I've had seriesFormat in the script for some time and thought I would attempt to add movieFormat to my amc script in utorrent but it didn't work so I took it out.
Now it doesn't work any more.

Running..

Code: Select all

filebot -script fn:amc --action hardlink --output "G:/Media" --action copy --conflict skip -non-strict --log-file amc.log --def unsorted=y reporterror=y storereport=y seriesFormat="T:/{n}/{s}/{n} - {s00e00} - {t}" excludelist=amc.txt --filter "age < 10" "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
Produces this error;

Code: Select all

File does not exist: ut_label=
File does not exist: ut_state=5
File does not exist: ut_title=American.Addict.2012.1080p.WEBRip.x265-RARBG
File does not exist: ut_kind=multi
File does not exist: ut_file=American.Addict.2012.1080p.WEBRip.x265-RARBG.mp4
File does not exist: ut_dir=E:\Seeding\American.Addict.2012.1080p.WEBRip.x265-RARBG
Run script [fn:amc] at [Thu May 06 23:49:48 AEST 2021]
Parameter: unsorted = y
Parameter: reporterror = y
Parameter: storereport = y
Parameter: seriesFormat = T:/{n}/{s}/{n} - {s00e00} - {t}
Parameter: excludelist = amc.txt
Invalid usage: no input
Abort (×_×)
Please, what is wrong with the amc script?

For reference I added the following after seriesFormat and before excludelist.

Code: Select all

movieFormat="{n.colon(' - ')} ({y}) - {vf} {tags}"
That broke the script, and when I removed it, it stayed broken. I'm not really fussed about making the movieFormat work... But I would like to restore the original script to working order.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc script broken

Post by rednoah »

YES:

Code: Select all

--def a=1 --def b=2 --def c=3
YES:

Code: Select all

--def a=1 b=2 c=3
NO:

Code: Select all

--def a=1 b=2 --filter "age < 10" c=3
YES:

Code: Select all

--def a=1 b=2 --filter "age < 10" --def c=3
YES:

Code: Select all

--filter "age < 10" --def a=1 b=2 c=3


tl;dr try this:

Code: Select all

filebot -script fn:amc --action duplicate --output "G:/Media" --conflict skip -non-strict --log-file amc.log --def unsorted=y reportError=y storeReport="G:/Report" seriesFormat="T:/{plex}" excludelist=amc.txt --def "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
:idea: This command fixes multiple mistakes. Please compare & contrast for details.


:!: --def name=value script parameters are case-sensitive.


:!: --action duplicate will hardlink if possible, or physically copy if necessary. This is generally what you want if you don't plan on modifying your media files.


:!: --filter is double-edged sword. Use with caution. Notably --filter "age < 10" will effectively prevent your from processing movies, due to movies usually being more than 10 days old. As for TV shows, age < 10 will likely give you the last 2 episodes which still leaves some room for error there too. The recommended usage is forcing TV series mode and using an age filter of less than a week.
:idea: Please read the FAQ and How to Request Help.
Tanyac
Posts: 20
Joined: 17 Nov 2014, 05:28

Re: How to to pass --def name=value script parameters on the command-line?

Post by Tanyac »

Sorry for the delay in responding.

I added hardlink after advice regarding an issue with processing time. The source and destination drives were the same spinner, resulting in a 30GB file taking about 40 minutes to process after download. Adding --hardlink didn't improve the situation. I changed the destination to g:/media which is a Samsung 970 Evo Plus SSD which dropped the processing time down to 5 minutes.

IIRC, I added age < 10 because I kept getting duplicate episodes (it was a long time ago so my memory might be failing me there).

I have another PC on which everything is automated, and the script works perfectly on that one. The only time I use this PC for TV episodes is if the other PC misses one or there is a new TV Series that ShowRSS does not yet support. I guess I should take out the age <10 completely then?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to to pass --def name=value script parameters on the command-line?

Post by rednoah »

Tanyac wrote: 11 May 2021, 02:34 The only time I use this PC for TV episodes is if the other PC misses one or there is a new TV Series that ShowRSS does not yet support. I guess I should take out the age <10 completely then?
In this case, you'll want to use --def "ut_label=TV" (i.e. replace variable %L with constant value TV) to force TV mode and --filter "age < 5" to force the recently aired episode. If you process episodes up to X days after release, then you will need to adjust your age filter to X days as well.

rednoah wrote: 01 Aug 2012, 13:04 Advanced Fine-Tuning
You can (and should) force Movie / Series / Anime mode by setting --def ut_label accordingly, and you can further define your own --filter rules to fine-tune matching to your exact needs, and avoid mismatches. For example, if one show is confused with another due to bad naming or missing data you can simply exclude the bad one, or if you only process recently aired episodes, then you could exclude episodes that have not aired recently from matching.

e.g. if you only process recently aired episodes you can virtually guarantee 100% auto-detection accuracy by adding simple filter rules such as these:

Code: Select all

--filter "age < 5" --def "ut_label=TV"
:idea: Please read the FAQ and How to Request Help.
Post Reply