OSX - Filebot first - Harlink second :)

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
shadoc
Posts: 6
Joined: 19 Mar 2020, 17:16

OSX - Filebot first - Harlink second :)

Post by shadoc »

Good morning all,

In these difficult times, confined to France, I automate a lot of action :) ... I have been using Filebot in drag'n'drop for a while and I just understood that we could also automate this.
Thanks to @rednoah who explains a lot. I read and reread these posts but I block quickly given my level.
Before automating I try to get the script to work in Terminal.

After installing Brew and updating the packages I test

Code: Select all

filebot -script fn:sysinfo
and i've

Code: Select all

Done ヾ(@⌒ー⌒@)ノ
8-)

I test this :

Code: Select all

script fn:amc --output "/Volumes/HDD_2/Test" --action hardlink --conflict override -non-strict --log-file amc.log --def unsorted=y music=y artwork=n "ut_label=" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" movieFormat="{genres.contains('Animation') ? 'Animation' : 'Films'} / {plex.name}" --lang fr
But i've this:

Code: Select all

Script started, output file is fn:amc
script: --output: No such file or directory

Script done, output file is fn:amc
Last edited by shadoc on 19 Mar 2020, 18:46, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OSX - Filebot first - Harlink second :)

Post by rednoah »

filebot commands start with filebot:

Code: Select all

filebot ...
:arrow: Please read the Run from cmdline section of the amc script manual for details on command-line usage.
:idea: Please read the FAQ and How to Request Help.
shadoc
Posts: 6
Joined: 19 Mar 2020, 17:16

Re: OSX - Filebot first - Harlink second :)

Post by shadoc »

Ok so sorry :o @rednoah

I Test this :

Code: Select all

filebot -script fn:amc --output "Volumes/HDD_2/Test" --action duplicate --conflict override -non-strict --log-file amc.log --def unsorted=y music=y artwork=n "ut_label=" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" movieFormat="{genres.contains('Animation') ? 'Animation' : 'Films'} / {plex.name}" --lang fr
I've this :

Code: Select all

Locking /Volumes/HDD_1/.filebot/logs/amc.log
Run script [fn:amc] at [Thu Mar 19 19:43:30 CET 2020]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = n
Parameter: ut_label = 
Parameter: ut_title = %N
Parameter: ut_kind = multi
Parameter: ut_dir = %F
Parameter: movieFormat = {genres.contains('Animation') ? 'Animation' : 'Films'} / {plex.name}
Bad ut_title value: %N
Bad ut_dir value: %F
Illegal usage: output folder must exist and must be a directory: /Volumes/HDD_1/Volumes/HDD_2/Test
Failure (°_°)
If i modifi my output and create Test in my Volume HDD_1

Code: Select all

filebot -script fn:amc --output "Test" --action duplicate --conflict override -non-strict --log-file amc.log --def unsorted=y music=y artwork=n "ut_label=" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" movieFormat="{genres.contains('Animation') ? 'Animation' : 'Films'} / {plex.name}" --lang fr
I've this :

Code: Select all

Locking /Volumes/HDD_1/.filebot/logs/amc.log
Run script [fn:amc] at [Thu Mar 19 20:25:01 CET 2020]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = n
Parameter: ut_label = 
Parameter: ut_title = %N
Parameter: ut_kind = multi
Parameter: ut_dir = %F
Parameter: movieFormat = {genres.contains('Animation') ? 'Animation' : 'Films'} / {plex.name}
Bad ut_title value: %N
Bad ut_dir value: %F
Illegal usage: no input
Failure (°_°)
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OSX - Filebot first - Harlink second :)

Post by rednoah »

Please read the Troubleshooting section of the amc script manual.
:idea: Please read the FAQ and How to Request Help.
shadoc
Posts: 6
Joined: 19 Mar 2020, 17:16

Re: OSX - Filebot first - Harlink second :)

Post by shadoc »

Hi @rednoah and thank you :)

Code: Select all

mac-pro-de-nico:~ nicolasverhaeghe$ filebot -script fn:amc --output "/Volumes/HDD_2/Test" --action hardlink -non-strict "/Volumes/HDD_2/Test/Unsorted" --log-file amc.log --def excludeList=amc.txt
Locking /Volumes/HDD_1/.filebot/logs/amc.log
Run script [fn:amc] at [Fri Mar 20 05:43:04 CET 2020]
Parameter: excludeList = amc.txt
Argument[0]: /Volumes/HDD_2/Test/Unsorted
Use excludes: /Volumes/HDD_2/Test/amc.txt (4)
Input: /Volumes/HDD_2/Test/Unsorted/xxxxxxxxx.S01E07.FRENCH.576p.DVDRip.AC3.x264-BajytcjtcjV.mkv
xattr: [xxxxxxxxx.S01E07.FRENCH.576p.DVDRip.AC3.x264-BajytcjtcjV.mkv] => [xxxxxxxxx - 1x07 - Alex's Choice]
Group: [tvs:xxxxxxxxx] => [xxxxxxxxx.S01E07.FRENCH.576p.DVDRip.AC3.x264-BajytcjtcjV.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [xxxxxxxxx]
Fetching episode data for [xxxxxxxxxx]
[HARDLINK] from [/Volumes/HDD_2/Test/Unsorted/xxxxxxxxxx.S01E07.FRENCH.576p.DVDRip.AC3.x264-BajytcjtcjV.mkv] to [/Volumes/HDD_2/Test/TV Shows/xxxxxxxxxx/Season 01/xxxxxxxxxx- S01E07 - Alex's Choice.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
mac-pro-de-nico:~ nicolasverhaeghe$ 
In the file I have the impression that he has applied it and not created a link because the 2 .mkv files are the same weight.

It may be normal but I would like to have a confirmation please because my goal is not to have 2 copies ^^
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OSX - Filebot first - Harlink second :)

Post by rednoah »

Yes, both files have the same file size, because both files are the same file. The physical data on disk exists only once though.


Please read up on how files work:
https://en.wikipedia.org/wiki/Hard_link


Please read this detailed exploration of how files work as well:
https://unix.stackexchange.com/a/120312/78608
:idea: Please read the FAQ and How to Request Help.
shadoc
Posts: 6
Joined: 19 Mar 2020, 17:16

Re: OSX - Filebot first - Harlink second :)

Post by shadoc »

Ok thanks @rednoah

I also noticed that the copy times were strangely super fast :)

I wonder if I can execute 2 scipts at the end of DL. In order to scan 2 different HDDs?

The hardlink works very well, however I find it difficult to achieve certain orders.

On the one hand here is my functional code:

Code: Select all

/usr/local/bin/filebot -script fn:amc --output "/Volumes/HDD_3/Films" --action hardlink -non-strict "/Volumes/HDD_3/Torrents/DL" --log-file amc.log --def excludeList=amc.txt --def unsorted=y music=y artwork=n "ut_label=" "ut_kind=multi" --lang fr
I manage to separate the subcategories (Animation / Films):

Code: Select all

/usr/local/bin/filebot -script fn:amc --output "/Volumes/HDD_3/Films" --action hardlink -non-strict "/Volumes/HDD_3/Torrents/DL" --log-file amc.log --def excludeList=amc.txt --def unsorted=y music=y artwork=n "ut_label=" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" movieFormat="{genres.contains('Animation') ? 'Animation' : 'Films'} /{plex.name}" --lang fr
Now I would like to have another entry in + ie 2 HDD.

Can I add a second line below? What syntax to adopt?

Here I put && knowing that it will not go :

Code: Select all

/usr/local/bin/filebot -script fn:amc --output "/Volumes/HDD_3/Films" --action hardlink -non-strict "/Volumes/HDD_3/Torrents/DL" --log-file amc.log --def excludeList=amc.txt --def unsorted=y music=y artwork=n "ut_label=" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" movieFormat="{genres.contains('Animation') ? 'Animation' : 'Films'} /{plex.name}" --lang fr && /usr/local/bin/filebot -script fn:amc --output "/Volumes/HDD_2/Films" --action hardlink -non-strict "/Volumes/HDD_2/Torrents/DL" --log-file amc.log --def excludeList=amc.txt --def unsorted=y music=y artwork=n "ut_label=" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" movieFormat="{genres.contains('Animation') ? 'Animation' : 'Films'} /{plex.name}" --lang fr
Post Reply