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

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
WilDieteren
Posts: 18
Joined: 24 Nov 2015, 11:29

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

Post 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.
User avatar
rednoah
The Source
Posts: 19692
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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.
:idea: Please read the FAQ and How to Request Help.
WilDieteren
Posts: 18
Joined: 24 Nov 2015, 11:29

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

Post 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.
User avatar
rednoah
The Source
Posts: 19692
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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
:idea: Please read the FAQ and How to Request Help.
WilDieteren
Posts: 18
Joined: 24 Nov 2015, 11:29

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

Post 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"
User avatar
rednoah
The Source
Posts: 19692
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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"
:idea: Please read the FAQ and How to Request Help.
WilDieteren
Posts: 18
Joined: 24 Nov 2015, 11:29

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

Post 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
User avatar
rednoah
The Source
Posts: 19692
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

Does qBT call your script? What does the console output say?


:idea: Please read Shell Script Debugging for Beginners.
:idea: Please read the FAQ and How to Request Help.
WilDieteren
Posts: 18
Joined: 24 Nov 2015, 11:29

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

Post by WilDieteren »

@rednoah,

Thanks for all your help, I will look into whether the script is called and get back to you.
WilDieteren
Posts: 18
Joined: 24 Nov 2015, 11:29

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

Post 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.
Post Reply