Page 1 of 1

Help with AMC script for qBittorent in Debian

Posted: 13 Jan 2021, 09:55
by Kopernikus
Hi,

I used to have a docker container running with qBittorrent and have Filebot (with Filbotnode) running as native dsm app on my Synology NAS.
However due lacking support for Wireguard and using DSM7 I created a virtual Debian machine just for the purpose of running Wireguard/qBittorent/Filebot/Proxy
All working fine, however now my Filbot needs to be adjusted for the task (using Plex format).

Before I had to scripts running:

For my movies:

Code: Select all

filebot -script 'dev:amc' /volume1/Downloads/completed/movies --output /volume1/video/Movies --action copy -non-strict --order Airdate --conflict auto --lang nl --def 'ut_label=Movie' 'music=y' 'unsorted=y' 'artwork=y' 'subtitles=nld' 'clean=y' 'skipExtract=y' 'plex=PRIVATE' 'excludeList=/volume1/video/filebot-exclude.txt' --apply refresh --log info --log-file '/data/.filebot-node/filebot.log'
For my series:

Code: Select all

filebot -script 'dev:amc' /volume1/Downloads/completed/movies --output /volume1/video/Movies --action copy -non-strict --order Airdate --conflict auto --lang nl --def 'ut_label=TV' 'music=y' 'unsorted=y' 'artwork=y' 'subtitles=nld' 'clean=y' 'skipExtract=y' 'plex=PRIVATE' 'excludeList=.excludes' --apply refresh --log info --log-file '/data/.filebot-node/filebot.log'
Now I wanted to combine those to scripts into 1, so that whenever a download is completed in Qbittorrent the script gets called.

Thx!

Re: Help with AMC script for qBittorent in Debian

Posted: 13 Jan 2021, 10:02
by rednoah
Here are the setup instructions for qBT:
viewtopic.php?t=215#p9774


:!: Note that a parent folder named movies will force Movie Mode, so you'll want to change that if you plan on relying on Movie / Series auto-detection.

Re: Help with AMC script for qBittorent in Debian

Posted: 13 Jan 2021, 10:13
by Kopernikus
Ok,

So I should have:

filebot -script fn:amc --output "/volume1/media" --action copy --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"

What's the difference between duplicate in the example and copy?
Also is the exclude list still needed?
And where can I add the "plex=PRIVATE"?
Also will the be standard the Plex format or do I also need to specify?

So as far as I understand I need to add to label movies and series in qBittorent? So the script now where to place the output? Or do I have to define this manual?

Re: Help with AMC script for qBittorent in Debian

Posted: 13 Jan 2021, 12:36
by rednoah
Action Duplicate means "try clone, try hardlink, try copy" whichever works.

I'd keep the exclude list. Just so that you can't accidentally infinite loop on your files.

The rest is just command line options as usual. I'd open a shell the play with it for a little while, to make sure I understand everything, before attempting to integrate my command into qBT.

Re: Help with AMC script for qBittorent in Debian

Posted: 19 Feb 2021, 13:45
by Kopernikus
@rednoah

Can you help plz?

My downloads: /mnt/Downloads
Media directory: /mnt/Media

Command I set in qBittorent:

filebot -script fn:amc --output "/mnt/Media" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"

The script runs, but is giving this error:

Code: Select all

File does not exist: 2
File does not exist: (2021)
File does not exist: 480p
File does not exist: Malayalam
File does not exist: [Hindi
File does not exist: +
File does not exist: Urdu
File does not exist: +
File does not exist: English
File does not exist: Subtitl ut_kind=multi ut_dir=/mnt/Downloads/completed/movies/Drishyam
File does not exist: 2
File does not exist: (2021)
File does not exist: 480p
File does not exist: Malayalam
File does not exist: [Hindi
File does not exist: +
File does not exist: Urdu
File does not exist: +
File does not exist: English
File does not exist: Subtitles]
File does not exist: HDRip
File does not exist: x264
File does not exist: AAC
File does not exist: By
File does not exist: Full4Movies.mkv
Run script [fn:amc] at [Fri Feb 19 14:26:59 CET 2021]
Invalid usage: no input
Abort (×_×)

Re: Help with AMC script for qBittorent in Debian

Posted: 19 Feb 2021, 19:34
by rednoah
Looks like argument is prematurely unquoted, breaking everything that comes after. You'll want to look into what exactly qBT is trying to execute after all the %variables have been replaced. Presumably, the value of %N contains a " double-quote or something along those lines.


:idea: Please read Cmdline and Argument Passing for details.

Re: Help with AMC script for qBittorent in Debian

Posted: 20 Feb 2021, 12:36
by Kopernikus
Hi,

Can't seem to find a fault like a double quote...
Can you help me how to test what could be wrong?

Re: Help with AMC script for qBittorent in Debian

Posted: 20 Feb 2021, 12:59
by rednoah
You'll want to call the sysenv script from qBT so that you can see the arguments that are passed along:

Code: Select all

filebot -script fn:sysenv --log-file sysenv.log --def "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"

Re: Help with AMC script for qBittorent in Debian

Posted: 25 Feb 2021, 14:34
by Kopernikus
@rednoah

Got it working, my license was expired :? bought new one...
However all seems te be working fine but I still have a few questions

If I do not define the format will "plex" be used as default?
If I download a torrent I use catagories/labels, should these be movies/series/music for the script? And does this override the auto media recognition?
And my last, if I want to download something that I don't wan't Filebot to move (like software), what would be the best aproach?

Thx

Re: Help with AMC script for qBittorent in Debian

Posted: 25 Feb 2021, 15:33
by rednoah
1.
{plex} is indeed the default format.


2.
The label can indeed be used to force Movie / Series / etc Mode. Please read the amc script manual for details.


3.
FileBot will only process media files, and ignore other file types. You can use a label such as Ignore to ignore all input files though, just in case you have non-movie non-episode mp4 files coming in.