Page 1 of 1

macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 28 Apr 2021, 12:37
by WilDieteren
L.S.,

I have a amc script that works perfectly for Transmission app. However since updating macOS to Big Sur Transmission no longer works so I am looking into using qBittorrent instead of Transmission. Can I use the Transmission amc script with qBittorent, so far I have not been able to figure that out? OS: macOS 11.3, Transmission V3.00, qBittorent V4.3.4.1.

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 28 Apr 2021, 12:46
by rednoah
The amc script is a generic command-line tool and not specific to either Transmission or qBT.


You can create your own qbt-postprocess.sh script and then call that from qBT, passing along input arguments as needed:
viewtopic.php?t=215#p9774

Code: Select all

/path/to/qbt-postprocess.sh "%F" "%N" "%L"

Your qbt-postprocess.sh script would look something like this:

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

...
Pretty much the same as transmission-postprocess.sh, except that our input arguments are now passed along via positional arguments instead of environment variables.

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 28 Apr 2021, 13:17
by WilDieteren
@rednoah,

I see what you mean (I think). However in de script I am using now I also have separate folders for TV shows and movies, and have set formats for naming of TV shows and movies. Not sure how to do add those to transmission-postprocess.sh or qbt-postprocess.sh.

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 28 Apr 2021, 15:35
by rednoah
If you're using Transmission, aren't you already using a modified transmission-postprocess.sh then? The proposed qbt-postprocess.sh would be virtually identical, except for the first few lines that define our ARG_* variables.


EDIT:

I'm working under the assumption that your Transmission integration looks like this:
viewtopic.php?t=215#p3380

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 28 Apr 2021, 17:01
by WilDieteren
@rednoah,

I am not sure how to do that for the separate folders for TV shows and movies or the formats for naming of TV shows and movies. Below the amc script I currently use with Transmission:

Code: Select all

/usr/local/bin/filebot -script fn:amc --output "/Volumes/Media HD/Media" --log-file "/Volumes/Media HD/Media/amc.log" --action duplicate --conflict auto -non-strict --def seriesDB="TheMovieDB::TV" --def subtitles=nl,en storeReport=y unsorted=y excludeList="/Volumes/Media HD/Media/amc.txt" "seriesFormat=/Volumes/Media HD/Media/TV Shows/{n}/{n} - {sxe} - {t}" "movieFormat=/Volumes/Media HD/Media/Movies/{n} {y}" "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 28 Apr 2021, 17:14
by rednoah
Well, I guess my previous post pretty much already has your solution then.


Write your script:

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

/usr/local/bin/filebot -script fn:amc --output "/Volumes/Media HD/Media" --log-file "/Volumes/Media HD/Media/amc.log" --action duplicate --conflict auto -non-strict --def seriesDB="TheMovieDB::TV" --def subtitles=nl,en storeReport=y unsorted=y excludeList="/Volumes/Media HD/Media/amc.txt" "seriesFormat=/Volumes/Media HD/Media/TV Shows/{n}/{n} - {sxe} - {t}" "movieFormat=/Volumes/Media HD/Media/Movies/{n} {y}" "ut_dir=$ARG_PATH" "ut_kind=multi" "ut_title=$ARG_NAME"

Make qBT call your script:

Code: Select all

/path/to/qbt-postprocess.sh "%F" "%N" "%L"

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 29 Apr 2021, 09:41
by WilDieteren
@rednoah,

I have done as you suggested, but it regretfully did not work. Both script and call of the script as above. Any additional suggestions?

P.S. You are correct that my Transmission integration looks like this:
viewtopic.php?t=215#p3380

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 29 Apr 2021, 09:42
by rednoah
Does qBT call your script? What does the console output say?


:idea: Please read Shell Script Debugging for Beginners.

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 29 Apr 2021, 09:50
by WilDieteren
@rednoah,

Thanks for all your help, I will look into whether the script is called and get back to you.

Re: macOS: Can the Transmission amc script be used for qBittorrent?

Posted: 03 May 2021, 08:49
by WilDieteren
@rednoah,

The script is working, not sure what has changed apart from replacing #!/bin/sh -xu by #!/bin/bash. Thanks for all your help, learned a bit about how amc works.