[Rpi] Filebot scripting with deluge

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Baleeverne
Posts: 6
Joined: 25 Jul 2015, 11:54

[Rpi] Filebot scripting with deluge

Post by Baleeverne »

Hello and first of all thank you for this awesome program ;) i've been using it on windows for a while now and it's so helpful.

Here's my problem, i'm trying to automatize the renaming process after finishing a download in Deluge. I'm not an expert in linux nor in scripting but i'm trying to learn ^^

So i have installed filebot (v4.5.6 hope it doesn't matter) and deluge and to automatize the process i've tried to copy the script you edited for Deluge

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -script fn:amc --output "$HOME/Media/Videos" --log-file amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME"
i've called the file "deluge-postprocess" with no extension. i've Chmod +rx it and put it in the /bin/ folder
when i launch deluge-postprocess i get

Code: Select all

Locking /opt/share/filebot/data/logs/amc.log
Parameter: music = y
Parameter: artwork = y
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title =
Invalid arguments: pass in either file arguments or ut_dir/ut_file parameters but not both
Failure (°_°)
in Deluge i added the command line 'deluge-postprocess" but it doesn't seem to do anything as i have nothing new in the amc.log file =/

Could you tell me what i did wrong?

Thanks =)
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi] Filebot scripting with deluge

Post by rednoah »

Why would you want to process your ENTIRE FILESYSTEM / with FileBot? You probably haven't set the required ENVIRONMENT VARIABLES when calling the script.

You can't just call the script. It has to be called by deluge (because deluge will set the environment variables).
:idea: Please read the FAQ and How to Request Help.
Baleeverne
Posts: 6
Joined: 25 Jul 2015, 11:54

Re: [Rpi] Filebot scripting with deluge

Post by Baleeverne »

Yeah i figured that only deluge could launch the script for it to work since it takes it variables from it. Yet the script is not called by deluge at the end of a download and that's where i'm stuck =/
Baleeverne
Posts: 6
Joined: 25 Jul 2015, 11:54

Re: [Rpi] Filebot scripting with deluge

Post by Baleeverne »

Could you please just tell me what i'm doing wrong ? =/
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi] Filebot scripting with deluge

Post by rednoah »

If the script (and filebot) is not called by deluge, there is little we here in the filebot forums can do. :D

General Linux advice:
* Make sure your script is called or not. (e.g. date > out.txt)
* Make sure filebot is called or not. (e.g. filebot ... > out.txt 2> err.txt)

@see http://www.cyberciti.biz/faq/linux-redi ... t-to-file/
:idea: Please read the FAQ and How to Request Help.
Baleeverne
Posts: 6
Joined: 25 Jul 2015, 11:54

Re: [Rpi] Filebot scripting with deluge

Post by Baleeverne »

Ok thanks i will try to fix it i'll let you know if i managed to do it ^^

Thanks again for a program that made our life easier ;)
Baleeverne
Posts: 6
Joined: 25 Jul 2015, 11:54

Re: [Rpi] Filebot scripting with deluge

Post by Baleeverne »

Well i gave up with using Deluge Execute command... Now i tried using crontab on a script i found and modified.

Here is the script

Code: Select all

/usr/bin/filebot -script fn:amc /media/Videos/TEMP/ --output /media/Videos/ --log-file /var/log/amc.log --action move --conflict skip -non-strict -unixfs --def artwork=n --lang fr --encoding UTF-8 --def ignore=".iso|txt|part01|part02|par1|par2" --def clean=y --def excludeList=/tmp/amc-input.txt --def "movieFormat=Films/{n}-({y}){'.cd'+pi}" --def "seriesFormat=SeriesFR/{n}/{n} - Season {s}/{n}-{S00E00}-{t}"
So this worked well but the movies i had were the 7 Police Academy movies minus the first one that i tried to move before and they seem to be recognized but fail to move them. It seems Filebot tries to move them as the same file. Here is my log :

Code: Select all

Parameter: artwork = n
Parameter: ignore = .iso|txt|part01|part02|par1|par2
Parameter: clean = y
Parameter: excludeList = /tmp/amc-input.txt
Parameter: seriesFormat = SeriesFR/{n}/{n} - Season {s}/{n}-{S00E00}-{t}
Parameter: movieFormat = Films/{n}({y}){'.cd'+pi}
Argument: /media/Videos/TEMP
Using excludes: /tmp/amc-input.txt (6)
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 2 1985 Their First Assignment.eng.srt
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 2 1985 Their First Assignment.mp4
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 3 1986 Back in Training.mp4
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 4 1987 Citizens on Patrol.eng.srt
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 4 1987 Citizens on Patrol.mp4
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 5 1988 Assignment Miami Beach.eng.srt
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 5 1988 Assignment Miami Beach.mp4
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 6 1989 City Under Siege.eng.srt
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 6 1989 City Under Siege.mp4
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 7 1994 Mission to Moscow.enghi.srt
Input: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 7 1994 Mission to Moscow.mp4
Exclude: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/- Info/Request Movie torrents here.txt
Exclude: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/- Info/Torrent downloaded from Demonoid.me.txt
Exclude: /media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/- Info/Torrent made by PetaFOX.txt
Police Academy 2 1985 Their First Assignment.eng.srt [series: null, movie: Police Academy 2: Their First Assignment (1985)]
Police Academy 2 1985 Their First Assignment.mp4 [series: null, movie: Police Academy 2: Their First Assignment (1985)]
Police Academy 3 1986 Back in Training.mp4 [series: null, movie: Police Academy 3: Back in Training (1986)]
Police Academy 4 1987 Citizens on Patrol.eng.srt [series: null, movie: Police Academy 4: Citizens on Patrol (1987)]
Police Academy 4 1987 Citizens on Patrol.mp4 [series: null, movie: Police Academy 4: Citizens on Patrol (1987)]
Police Academy 5 1988 Assignment Miami Beach.eng.srt [series: null, movie: Police Academy 5: Assignment Miami Beach (1988)]
Police Academy 5 1988 Assignment Miami Beach.mp4 [series: null, movie: Police Academy 5: Assignment Miami Beach (1988)]
Police Academy 6 1989 City Under Siege.eng.srt [series: null, movie: Police Academy 6: City Under Siege (1989)]
Police Academy 6 1989 City Under Siege.mp4 [series: null, movie: Police Academy 6: City Under Siege (1989)]
Police Academy 7 1994 Mission to Moscow.enghi.srt [series: null, movie: Police Academy: Mission to Moscow (1994)]
Police Academy 7 1994 Mission to Moscow.mp4 [series: null, movie: Police Academy: Mission to Moscow (1994)]
Group: [tvs:null, mov:police academy 2 their first assignment 1985, anime:null] => [Police Academy 2 1985 Their First Assignment.eng.srt, Police Academy 2 1985 Their First Assignment.mp4]
Group: [tvs:null, mov:police academy 3 back in training 1986, anime:null] => [Police Academy 3 1986 Back in Training.mp4]
Group: [tvs:null, mov:police academy 4 citizens on patrol 1987, anime:null] => [Police Academy 4 1987 Citizens on Patrol.eng.srt, Police Academy 4 1987 Citizens on Patrol.mp4]
Group: [tvs:null, mov:police academy 5 assignment miami beach 1988, anime:null] => [Police Academy 5 1988 Assignment Miami Beach.eng.srt, Police Academy 5 1988 Assignment Miami Beach.mp4]
Group: [tvs:null, mov:police academy 6 city under siege 1989, anime:null] => [Police Academy 6 1989 City Under Siege.eng.srt, Police Academy 6 1989 City Under Siege.mp4]
Group: [tvs:null, mov:police academy mission to moscow 1994, anime:null] => [Police Academy 7 1994 Mission to Moscow.enghi.srt, Police Academy 7 1994 Mission to Moscow.mp4]
Rename movies using [TheMovieDB]
[MOVE] Rename [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 2 1985 Their First Assignment.mp4] to [/media/Videos/Films/Police Academy(1984).mp4]
[MOVE] Rename [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 2 1985 Their First Assignment.eng.srt] to [/media/Videos/Films/Police Academy(1984).srt]
Processed 2 files
Rename movies using [TheMovieDB]
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 3 1986 Back in Training.mp4] because [/media/Videos/Films/Police Academy(1984).mp4] already exists
Processed 1 files
Rename movies using [TheMovieDB]
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 4 1987 Citizens on Patrol.mp4] because [/media/Videos/Films/Police Academy(1984).mp4] already exists
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 4 1987 Citizens on Patrol.eng.srt] because [/media/Videos/Films/Police Academy(1984).srt] already exists
Processed 2 files
Rename movies using [TheMovieDB]
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 5 1988 Assignment Miami Beach.mp4] because [/media/Videos/Films/Police Academy(1984).mp4] already exists
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 5 1988 Assignment Miami Beach.eng.srt] because [/media/Videos/Films/Police Academy(1984).srt] already exists
Processed 2 files
Rename movies using [TheMovieDB]
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 6 1989 City Under Siege.mp4] because [/media/Videos/Films/Police Academy(1984).mp4] already exists
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 6 1989 City Under Siege.eng.srt] because [/media/Videos/Films/Police Academy(1984).srt] already exists
Processed 2 files
Rename movies using [TheMovieDB]
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 7 1994 Mission to Moscow.mp4] because [/media/Videos/Films/Police Academy(1984).mp4] already exists
Skipped [/media/Videos/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 7 1994 Mission to Moscow.enghi.srt] because [/media/Videos/Films/Police Academy(1984).srt] already exists
Processed 2 files
Clean clutter files and empty folders
Done ヾ(@⌒ー⌒@)ノ
As you can see, filebot moved Police Academy 2 as Police Academy 1 even if it recognized it during the scraping =/
Thanks again =)
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi] Filebot scripting with deluge

Post by rednoah »

Make sure you don't have any misleading *.nfo files or such.

I can't reproduce the issue:

Code: Select all

Rename movies using [TheMovieDB]
Auto-detect movie from context: [/Users/reinhard/Development/test/AMC-TEST/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 2 1985 Their First Assignment.mp4]
Stripping invalid characters from new path: Movies/Police Academy 2: Their First Assignment (1985)/Police Academy 2: Their First Assignment (1985)
[DUPLICATE] Rename [/Users/reinhard/Development/test/AMC-TEST/TEMP/Police Academy 1-7 collection 720p x264 ac3 jbr/Police Academy 2 1985 Their First Assignment.mp4] to [/Users/reinhard/Development/test/OUTPUT/Movies/Police Academy 2 Their First Assignment (1985)/Police Academy 2 Their First Assignment (1985).mp4]
:idea: Please read the FAQ and How to Request Help.
Baleeverne
Posts: 6
Joined: 25 Jul 2015, 11:54

Re: [Rpi] Filebot scripting with deluge

Post by Baleeverne »

okay there was indeed a NFO file and deleting it solved the problem. Isn't there a way to tell filebot to ignore the nfos? (putting it in the ignore parameter doesn't work =o


Thanks a bunch anyway =DDD
Post Reply