Page 1 of 1
OSX - Filebot first - Harlink second :)
Posted: 19 Mar 2020, 18:31
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
and i've
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
Re: OSX - Filebot first - Harlink second :)
Posted: 19 Mar 2020, 18:43
by rednoah
filebot commands start with
filebot:

Please read the
Run from cmdline section of the
amc script manual for details on command-line usage.
Re: OSX - Filebot first - Harlink second :)
Posted: 19 Mar 2020, 18:47
by shadoc
Ok so sorry 
@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 (°_°)
Re: OSX - Filebot first - Harlink second :)
Posted: 19 Mar 2020, 19:32
by rednoah
Please read the
Troubleshooting section of the
amc script manual.
Re: OSX - Filebot first - Harlink second :)
Posted: 20 Mar 2020, 04:51
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 ^^
Re: OSX - Filebot first - Harlink second :)
Posted: 20 Mar 2020, 06:34
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
Re: OSX - Filebot first - Harlink second :)
Posted: 20 Mar 2020, 14:17
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