Moving from Transmission to QBittorrent - trouble with AMC

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Moving from Transmission to QBittorrent - trouble with AMC

Post by mikejandreau »

I've had Transmission working with AMC for years without issue, but I'm now moving to QBitorrent for better native M1 support.

I've got the script setup as the instructions dictate (

Code: Select all

filebot -script fn:amc --output "/Volumes/Iron Storage/Video/To Be Processed" --action duplicate --conflict skip -non-strict --log-file ~/Desktop/amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=n "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L”
)

But when a torrent completes, nothing happens. Nothing gets added to the amc.log file on my desktop and the file doesn't get run through filebot.

If I run the same command on a test torrent from Terminal (ie;

Code: Select all

filebot -script fn:amc --output "/Volumes/Iron Storage/Video/To Be Processed" --action duplicate --conflict skip -non-strict --log-file ~/Desktop/amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=/Volumes/Iron Storage/Video/testTorrent" "ut_kind=multi" "ut_title=Moon Knight" "ut_label=TEST"
) it works immediately.

How can I get some debugging from QBittorrent to figure out why it's failing to execute the script? Qbittorrent has full disk permission, so it shoudn't be a permissions thing, but without seeing why it's failing, I'm struggling to get it to work.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Moving from Transmission to QBittorrent - trouble with AMC

Post by rednoah »

mikejandreau wrote: 13 Apr 2022, 13:28 How can I get some debugging from QBittorrent to figure out why it's failing to execute the script?
Please read Shell Script Debugging for Beginners. The first step is to call any arbitrary command just to confirm that qBT is in fact calling your command. From there it's just trial and error.


:!: Did you type your command in Google Docs or Apple Pages? Because "...” (NOTE: the second " was replaced with ” by some software) is definitely not the same as "..." and will definitely break the command-line...

Code: Select all

"...”
"..."

:!: ~ is a shell thing. Does qBT replace ~? I don't know. Use the absolute path so you don't have to worry about that.
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Moving from Transmission to QBittorrent - trouble with AMC

Post by mikejandreau »

Got it.

I updated the Script to

Code: Select all

printenv > "/Volumes/Iron Storage/Video/To Be Processed/log.txt"
When a test torrent completes, I get no log.txt file in that directory. So I'm guessing it's a permissions thing. QBittorrent hasn't asked for permission to that Volume, but I gave it full disk access in macOS' security preference.

Any thoughts on what else I can try?

Edit: QBittorrent logs show it's running the script

Code: Select all

(N) 2022-04-13T11:17:00 - Torrent: Moon.Knight.S01E02.WEB.x264-TORRENTGALAXY, running external program, command: printenv > "/Volumes/Iron Storage/Video/To Be Processed/log.txt"
But that log.txt file never shows up.

Edit 2: Found there's a bug with the current version of QBittorrent that doesn't pass the bash command to the script. I got it to ouput a log with

Code: Select all

bash -c "echo "%N" > output.log"
. Now I just need to figure out how to couple that with filebot to get it all to work together.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Moving from Transmission to QBittorrent - trouble with AMC

Post by rednoah »

> is a shell thing. I would not expect that to work in qBT.

If you paste this into qBT:

Code: Select all

echo Hello > log.txt
then qBT will interpret this as command followed by arguments:

Code: Select all

echo "Hello" ">" "log.txt"

This also probably won't work the way you meant it, because the inner "..." break the outer "..." and then something will a awry in unexpected ways:

Code: Select all

bash -c "echo "%N" > output.log"
Here's how you pass a command as single argument value:

Code: Select all

bash -c "echo '%N' > output.log"


:arrow: Since ~ is a bash thing, and qBT doesn't do bash things, we can now assume that --log-file ~/Desktop/amc.log doesn't work the way you want it to work. I'd start by using an absolute path here and then see if you get logs. Too much technical exposition. Just focus on the green text. :lol:
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Moving from Transmission to QBittorrent - trouble with AMC

Post by mikejandreau »

Finally got it to work.

It looks like Homebrew installs Filebot to a different location on M1 Macs, so I needed

Code: Select all

/opt/homebrew/bin/filebot -script fn:amc --output "/Volumes/Iron Storage/Video/To Be Processed" --action copy --conflict skip -non-strict --log-file /Users/mj/Desktop/amc.log --def unsorted=y music=y artwork=y "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"
to get it to work.

Humming along nicely now, though. Thanks for the help!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Moving from Transmission to QBittorrent - trouble with AMC

Post by rednoah »

On macOS, /usr/local/bin is not in the $PATH for by default. It's another thing that only works in the shell, because the shell adds that folder to the $PATH but the system itself doesn't search for executables there, and so qBT won't either.


:arrow: The absolute path to the executable is again the solution:
Image
:idea: Please read the FAQ and How to Request Help.
Post Reply