Qbittorrent-filebot script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
tronder
Posts: 13
Joined: 03 Jun 2024, 22:45

Qbittorrent-filebot script

Post by tronder »

Hi All,

I've been trying to run a qbittorrent-filebot script on unraid. I don't understand how to edit the file to make it do what I want.

1. I would like it to clean up any left over folders after sorting. I believe this is achieved with --def clean=y\ but it doesn't seem to run the script if i make the change even after restarting the docker, do i have the --def clean in the wrong spot'? :?

2. Is there a way to have it move the file but not sort files into categories e.g. TV shows=> XXX show => Season 1 etc

On qbittorrent the following commands are set to run external command /data/filebot/fb.sh "%F" "%N" "%L"

Current Command fb.sh

Shell: Select all

#!/bin/bash
# Future feature
#if [ ! -f /filebot/osdb.loggedin ]; then
# printf "$OSDB_USER\n$OSDB_PASSWD\n" | /filebot/filebot.sh -script fn:configure
# touch /filebot/osdb.loggedin
#fi

# Set this to 1 if you want to customize the fb.sh script. So it won't be reset at restart.
custom=0

/filebot/filebot.sh \
-script fn:amc \
--output /media \
--lang "$FILEBOT_LANG" \
--action "$FILEBOT_ACTION" \
--conflict "$FILEBOT_CONFLICT" \
--log-file /data/filebot/filebot.log \
--def excludeList=/data/filebot/amc-exlude-list.txt \
--def clean=y \
-non-strict \
--def \
unsorted=y \
music="$FILEBOT_PROCESS_MUSIC" \
musicFormat=/media/"$MUSIC_FORMAT" \
artwork=/media/"$FILEBOT_ARTWORK" \
movieFormat=/media/"$MOVIE_FORMAT" \
seriesFormat=/media/"$SERIE_FORMAT" \
animeFormat=/media/"$ANIME_FORMAT" \
ut_dir="$1" \
ut_title="$2" \
ut_label="$3"
User avatar
rednoah
The Source
Posts: 23922
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Qbittorrent-filebot script

Post by rednoah »

tronder wrote: 03 Jun 2024, 22:52 1. I would like it to clean up any left over folders after sorting. I believe this is achieved with --def clean=y\ but it doesn't seem to run the script if i make the change even after restarting the docker, do i have the --def clean in the wrong spot'? :?
:?: What does the log say when it doesn't work?

tronder wrote: 03 Jun 2024, 22:52 2. Is there a way to have it move the file but not sort files into categories e.g. TV shows=> XXX show => Season 1 etc
Yes. The target file path is entirely up to your custom format.
:idea: Please read the FAQ and How to Request Help.
tronder
Posts: 13
Joined: 03 Jun 2024, 22:45

Re: Qbittorrent-filebot script

Post by tronder »

rednoah wrote: 03 Jun 2024, 23:46
tronder wrote: 03 Jun 2024, 22:52 1. I would like it to clean up any left over folders after sorting. I believe this is achieved with --def clean=y\ but it doesn't seem to run the script if i make the change even after restarting the docker, do i have the --def clean in the wrong spot'? :?
:?: What does the log say when it doesn't work?
So When I edit the script the script seems to not run after a download. I tried changing the 0 to 1 at the top and all diffrent combinations. but if i don't edit the script, this is what it says in the log

Console Output: Select all

Initialize new disk cache: /filebot/data/99/cache/0
Run script [fn:amc] at [Mon Jun 03 23:57:54 AEST 2024]

[PSA] Important Discussion of Changes effective as of 28 Apr 2023:
https://www.filebot.net/forums/viewtopic.php?t=13406

Parameter: excludeList = /data/filebot/amc-exlude-list.txt
Parameter: unsorted = y
Parameter: music = y
Parameter: musicFormat = /media/{plex}
Parameter: artwork = /media/y
Parameter: movieFormat = /media/{plex}
Parameter: seriesFormat = /media/{plex}
Parameter: animeFormat = /media/animes/{n}/{e.pad(3)} - {t}
Parameter: ut_dir = /downloads/www.TORRENTING.com   -    ***** 2024 S01E01 1080p HEVC x265-MeGusta
Parameter: ut_title = ****** 2024 S01E01 1080p HEVC x265-MeGusta
Parameter: ut_label = 
Use excludes: /data/filebot/amc-exlude-list.txt (0)
Input: /downloads/www.TORRENTING.com   -    ******2024 S01E01 1080p HEVC x265-MeGusta/*****.2024.S01E01.1080p.HEVC.x265-MeGusta.mkv
Group files by movie or series
Group: {Series=****** (2024)} => [******.2024.S01E01.1080p.HEVC.x265-MeGusta.mkv]
Rename episodes using [TheMovieDB] with [Airdate Order]
Lookup via [******] [***** 2024]
Fetching episode data for [******]
* ****** [106379] | 8 episodes | 1x01-08
Activate License [PX56320724] on [Mon Jun 03 23:57:59 AEST 2024]
[MOVE] from [/downloads/www.TORRENTING.com   -    ******2024 S01E01 1080p HEVC x265-MeGusta/*****.2024.S01E01.1080p.HEVC.x265-MeGusta.mkv] to [/media/TV Shows/******/Season 01/******- S01E01 - The ***.mkv]
Processed 1 file
Done ヾ(@⌒ー⌒@)ノ
rednoah wrote: 03 Jun 2024, 23:46
tronder wrote: 03 Jun 2024, 22:52 2. Is there a way to have it move the file but not sort files into categories e.g. TV shows=> XXX show => Season 1 etc
Yes. The target file path is entirely up to your custom format.

Where in the script do I add { drive }/Media/TV Shows/ to direct it?
User avatar
rednoah
The Source
Posts: 23922
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Qbittorrent-filebot script

Post by rednoah »

:!: The console output does NOT show --def clean=y passed along. The clean up behaviour is thus not enabled.

:!: Where did you copy your code from? The --def artwork=y option is being passed in correctly, the value you are passing is /media/y and this will always evaluate to false since it's not y:

Console Output: Select all

artwork=/media/"$FILEBOT_ARTWORK" \
Parameter: artwork = /media/y



:idea: You are passing /media/{plex} as format, you therefore get /media/ followed by the {plex} path, no surprise there:

Code: Select all

Parameter: movieFormat = /media/{plex}

Code: Select all

/media/Movies/Avatar (2009)/Avatar (2009)
:arrow: You'll want to pass { ~plex.id } as format:

Shell: Select all

--def movieFormat="{ ~plex.id }"
rednoah wrote: 12 Sep 2016, 10:03 e.g. Avatar (2009)/Avatar (2009)

Format: Select all

{ ~plex }
e.g. Avatar (2009) {tmdb-19995}/Avatar (2009)

Format: Select all

{ ~plex.id }
:idea: The format produces a relative path which is then resolved against your --output folder.
:idea: Please read the FAQ and How to Request Help.
Post Reply