deluge/Vuze script in Linux

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

deluge/Vuze script in Linux

Post by Calcky82 »

Dear Rednoah,

I used the utorrent-script in Windos for several years now and it works flawless. Its almost amazing how good it works. So thank you very much for that.
I'm changing to Linux Mint now and want to ask you short questions. The rest I’ll try to figure out myself:

1. How do I make Vuze/Deluge execute the Shell-script. What do i type in the box "execute when torrent complete" in Deluge?
2. Where, in which folder, do I place the shell-script.
3. Please tell me how to "make sure Filebot can be called" (or a link to information)

I΅sorry, I know, stupid questions, but I'm just starting Linux. (and i like it!)
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: deluge/Vuze script in Linux

Post by rednoah »

1.
Did you read the Deluge instructions yet?
viewtopic.php?f=4&t=215#p3382


2.
Anywhere is fine, as long as Deluge can read/execute the script file. Your user home should be fine.


3.
Shell Script Debugging for Beginners:
viewtopic.php?f=4&t=3067
:idea: Please read the FAQ and How to Request Help.
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

Thank you

Yes I read everything.

You write:
Execute, add a new Torrent Complete event and set it to call our shell script.
Apperently I'm not doing that correct, because nothing happens.

This is the script I'm using now.(deluge-postprocess.sh)

Code: Select all

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

filebot -script fn:amc --output "$HOME/Video's" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=.excludes unsorted=y music=y artwork=y "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME"

Also wanna try

Code: Select all

whoami > "/path/to/log.txt"
but I don't know where that path is.

If you're newby you need more specific instructions.

I I execute deluge-postprocces.sh manualy it works fine by the way.
Last edited by Calcky82 on 03 Mar 2016, 09:20, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: deluge/Vuze script in Linux

Post by rednoah »

If it's not working, then the next step is to figure out why, starting with making sure that the script is called, and getting all the output:
viewtopic.php?f=4&t=3067


"/path/to/log.txt" is just an example. You should use your own path, for example your user home.
:idea: Please read the FAQ and How to Request Help.
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

OK. Followd the debugging the instructions:

This is my deluge-postprocess.sh:

Code: Select all

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

printenv > "/home/jeroen/log.txt"

filebot -script fn:sysenv > "/home/jeroen/log.txt" 2>&1

filebot -script fn:amc --output "$HOME/Media" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=.excludes unsorted=y music=y artwork=y "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME"
It only creates .log if executed manualy:

Code: Select all

# Environment Variables #
XDG_SESSION_COOKIE: e9d13bb15b47fc14e37efb6856d6263e-1456992039.91967-1185757398
DESKTOP_SESSION: cinnamon
WINDOWPATH: 8
SSH_AUTH_SOCK: /run/user/1000/keyring-PBTiVO/ssh
LD_LIBRARY_PATH: /usr/share/filebot
XDG_CURRENT_DESKTOP: X-Cinnamon
XDG_VTNR: 8
WINDOWID: 46137352
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
MDMSESSION: cinnamon
XFILESEARCHPATH: /usr/dt/app-defaults/%L/Dt
GNOME_DESKTOP_SESSION_ID: this-is-deprecated
XDG_SESSION_DESKTOP: cinnamon
GDMSESSION: cinnamon
DEFAULTS_PATH: /usr/share/gconf/cinnamon.default.path
CLUTTER_BACKEND: x11
LOGNAME: jeroen
XAUTHORITY: /home/jeroen/.Xauthority
DERBY_HOME: /usr/lib/jvm/java-8-oracle/db
TEXTDOMAIN: im-config
SHELL: /bin/bash
VTE_VERSION: 3409
DBUS_SESSION_BUS_ADDRESS: unix:abstract=/tmp/dbus-dKOxF9WuL9,guid=9ea5da683c05f92b4c57596256d7ef28
PWD: /home/jeroen
XDG_DATA_DIRS: /usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/
J2SDKDIR: /usr/lib/jvm/java-8-oracle
MANDATORY_PATH: /usr/share/gconf/cinnamon.mandatory.path
XDG_RUNTIME_DIR: /run/user/1000
TERM: xterm
NLSPATH: /usr/dt/lib/nls/msg/%L/%N.cat
LANG: nl_NL.UTF-8
JAVA_HOME: /usr/lib/jvm/java-8-oracle
GDM_XSERVER_LOCATION: local
SESSION_MANAGER: local/jeroen-System-Product-Name:@/tmp/.ICE-unix/1756,unix/jeroen-System-Product-Name:/tmp/.ICE-unix/1756
QT_STYLE_OVERRIDE: gtk
DISPLAY: :0.0
XDG_CONFIG_DIRS: /etc/xdg/xdg-cinnamon:/etc/xdg
TEXTDOMAINDIR: /usr/share/locale/
INSIDE_NEMO_PYTHON: 
GPG_AGENT_INFO: /run/user/1000/keyring-PBTiVO/gpg:0:1
COLORTERM: gnome-terminal
J2REDIR: /usr/lib/jvm/java-8-oracle/jre
HOME: /home/jeroen
XDG_SEAT: seat0
MDM_XSERVER_LOCATION: local
XDG_SESSION_ID: c1
GNOME_KEYRING_CONTROL: /run/user/1000/keyring-PBTiVO
SSH_AGENT_PID: 1821
MDM_LANG: nl_NL.UTF-8
USER: jeroen
USERNAME: jeroen


# Java System Properties #
path.separator: :
sun.desktop: gnome
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.io.tmpdir: /home/jeroen/.filebot/temp
user.country: NL
user.home: /home/jeroen
useExtendedFileAttributes: true
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
java.vm.vendor: Oracle Corporation
user.language: nl
java.vendor: Oracle Corporation
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
sun.net.client.defaultReadTimeout: 60000
java.specification.name: Java Platform API Specification
jna.nosys: true
os.name: Linux
java.runtime.name: Java(TM) SE Runtime Environment
application.deployment: deb
file.separator: /
sun.net.client.defaultConnectTimeout: 10000
java.vm.specification.version: 1.8
sun.boot.class.path: /usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/classes
java.version: 1.8.0_74
http.agent: FileBot 4.6.1
java.library.path: /usr/share/filebot:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
unixfs: false
useGVFS: false
awt.toolkit: sun.awt.X11.XToolkit
java.vm.specification.name: Java Virtual Machine Specification
os.version: 3.19.0-32-generic
useCreationDate: false
file.encoding: UTF-8
java.awt.printerjob: sun.print.PSPrinterJob
grape.root: /home/jeroen/.filebot/grape
java.class.version: 52.0
java.ext.dirs: /usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/java/packages/lib/ext
java.specification.version: 1.8
net.filebot.AcoustID.fpcalc: /usr/share/filebot/fpcalc
java.vendor.url: http://java.oracle.com/
ehcache.disk.store.dir: /home/jeroen/.filebot/cache/0
sun.os.patch.level: unknown
sun.java.launcher: SUN_STANDARD
os.arch: amd64
user.dir: /home/jeroen
line.separator: 

user.timezone: 
sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
java.home: /usr/lib/jvm/java-8-oracle/jre
java.net.useSystemProxies: false
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.arch.data.model: 64
java.endorsed.dirs: /usr/lib/jvm/java-8-oracle/jre/lib/endorsed
file.encoding.pkg: sun.io
java.specification.vendor: Oracle Corporation
sun.boot.library.path: /usr/lib/jvm/java-8-oracle/jre/lib/amd64
sun.jnu.encoding: UTF-8
java.runtime.version: 1.8.0_74-b02
java.vm.info: mixed mode
java.vm.version: 25.74-b02
sun.io.unicode.encoding: UnicodeLittle
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
application.dir: /home/jeroen/.filebot
java.class.path: /usr/share/filebot/FileBot.jar
sun.java.command: /usr/share/filebot/FileBot.jar -script fn:sysenv
sun.cpu.isalist: 
user.name: jeroen


# Arguments #
args[0] = -script
args[1] = fn:sysenv


Done ヾ(@⌒ー⌒@)ノ
But what do I type in the execute-plug-in in Deluge, behind Torrent complete? Only deluge-postprocess.sh? Or /home/jeroen/deluge-postprocess.sh?
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

It worked already without me knowing because i didin't saw anything happen. But I just stumbled uppon some videos files in the Media-map that i downloaded. Perfect.

Thank you!
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

If it set the outputfolder in de scrip to my NAS it doen't work. I mounted my NAS the folder is: /media/NAS
Any Ideas?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: deluge/Vuze script in Linux

Post by rednoah »

What do the logs say?
:idea: Please read the FAQ and How to Request Help.
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

I'm sorry man. I'm assuming you don't mean the log file on the bottem of this post. And i can't find Deluge's logfile. I think i've to activate it in the terminal but as you might know I'm no linux hero (yet) :)

I found this on the help page of Deluge:

Create a log directory for Deluge and give the service user (e.g. deluge), full access:

Code: Select all

sudo mkdir -p /var/log/deluge
sudo chown -R deluge:deluge /var/log/deluge
sudo chmod -R 750 /var/log/deluge
The deluge log directory is now configured so that user deluge has full access, group deluge read only and everyone else denied access. The umask specified in the services sets the permission of new log files.

Code: Select all

ExecStart=/usr/bin/deluged -d -l /var/log/deluge/daemon.log -L warning
Enable logging in the service files by editing the ExecStart line, appending -l and -L options:

Code: Select all

ExecStart=/usr/bin/deluge-web -l /var/log/deluge/web.log -L warning

See Deluge Logging for all available log-levels.

Restart the services:

systemctl restart deluged
systemctl restart deluge-web[/i]

But

Code: Select all

sudo chown -R deluge:deluge /var/log/deluge
i get error: invalid user.

Code: Select all

# Environment Variables #
XDG_SESSION_COOKIE: e9d13bb15b47fc14e37efb6856d6263e-1457074443.354009-851423896
DESKTOP_SESSION: cinnamon
WINDOWPATH: 8
SSH_AUTH_SOCK: /run/user/1000/keyring-3cJ2kB/ssh
LD_LIBRARY_PATH: /usr/share/filebot
XDG_CURRENT_DESKTOP: X-Cinnamon
XDG_VTNR: 8
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
MDMSESSION: cinnamon
XFILESEARCHPATH: /usr/dt/app-defaults/%L/Dt
GNOME_DESKTOP_SESSION_ID: this-is-deprecated
XDG_SESSION_DESKTOP: cinnamon
GIO_LAUNCHED_DESKTOP_FILE_PID: 3116
GDMSESSION: cinnamon
DEFAULTS_PATH: /usr/share/gconf/cinnamon.default.path
CLUTTER_BACKEND: x11
GIO_LAUNCHED_DESKTOP_FILE: /usr/share/applications/deluge.desktop
LOGNAME: jeroen
XAUTHORITY: /home/jeroen/.Xauthority
DERBY_HOME: /usr/lib/jvm/java-8-oracle/db
TEXTDOMAIN: im-config
SHELL: /bin/bash
DBUS_SESSION_BUS_ADDRESS: unix:abstract=/tmp/dbus-9iaRfeDUY5,guid=af943bd166797cda72b686f856d9310b
PWD: /home/jeroen
XDG_DATA_DIRS: /usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/
J2SDKDIR: /usr/lib/jvm/java-8-oracle
MANDATORY_PATH: /usr/share/gconf/cinnamon.mandatory.path
XDG_RUNTIME_DIR: /run/user/1000
NLSPATH: /usr/dt/lib/nls/msg/%L/%N.cat
LANG: nl_NL.UTF-8
JAVA_HOME: /usr/lib/jvm/java-8-oracle
GDM_XSERVER_LOCATION: local
DESKTOP_AUTOSTART_ID: 10ea4bfe91e78b0f65145707444428632300000016400006
SESSION_MANAGER: local/jeroen-System-Product-Name:@/tmp/.ICE-unix/1640,unix/jeroen-System-Product-Name:/tmp/.ICE-unix/1640
QT_STYLE_OVERRIDE: gtk
DISPLAY: :0
XDG_CONFIG_DIRS: /etc/xdg/xdg-cinnamon:/etc/xdg
TEXTDOMAINDIR: /usr/share/locale/
GPG_AGENT_INFO: /run/user/1000/keyring-3cJ2kB/gpg:0:1
J2REDIR: /usr/lib/jvm/java-8-oracle/jre
HOME: /home/jeroen
XDG_SEAT: seat0
MDM_XSERVER_LOCATION: local
XDG_SESSION_ID: c1
GNOME_KEYRING_CONTROL: /run/user/1000/keyring-3cJ2kB
SSH_AGENT_PID: 1705
MDM_LANG: nl_NL.UTF-8
USER: jeroen
USERNAME: jeroen


# Java System Properties #
path.separator: :
sun.desktop: gnome
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.io.tmpdir: /home/jeroen/.filebot/temp
user.country: NL
user.home: /home/jeroen
useExtendedFileAttributes: true
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
java.vm.vendor: Oracle Corporation
user.language: nl
java.vendor: Oracle Corporation
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
sun.net.client.defaultReadTimeout: 60000
java.specification.name: Java Platform API Specification
jna.nosys: true
os.name: Linux
java.runtime.name: Java(TM) SE Runtime Environment
application.deployment: deb
file.separator: /
sun.net.client.defaultConnectTimeout: 10000
java.vm.specification.version: 1.8
sun.boot.class.path: /usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/classes
java.version: 1.8.0_74
http.agent: FileBot 4.6.1
java.library.path: /usr/share/filebot:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
unixfs: false
useGVFS: false
awt.toolkit: sun.awt.X11.XToolkit
java.vm.specification.name: Java Virtual Machine Specification
os.version: 3.19.0-32-generic
useCreationDate: false
file.encoding: UTF-8
java.awt.printerjob: sun.print.PSPrinterJob
grape.root: /home/jeroen/.filebot/grape
java.class.version: 52.0
java.ext.dirs: /usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/java/packages/lib/ext
java.specification.version: 1.8
net.filebot.AcoustID.fpcalc: /usr/share/filebot/fpcalc
java.vendor.url: http://java.oracle.com/
ehcache.disk.store.dir: /home/jeroen/.filebot/cache/0
sun.os.patch.level: unknown
sun.java.launcher: SUN_STANDARD
os.arch: amd64
user.dir: /home/jeroen
line.separator: 

user.timezone: 
sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
java.home: /usr/lib/jvm/java-8-oracle/jre
java.net.useSystemProxies: false
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.arch.data.model: 64
java.endorsed.dirs: /usr/lib/jvm/java-8-oracle/jre/lib/endorsed
file.encoding.pkg: sun.io
java.specification.vendor: Oracle Corporation
sun.boot.library.path: /usr/lib/jvm/java-8-oracle/jre/lib/amd64
sun.jnu.encoding: UTF-8
java.runtime.version: 1.8.0_74-b02
java.vm.info: mixed mode
java.vm.version: 25.74-b02
sun.io.unicode.encoding: UnicodeLittle
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
application.dir: /home/jeroen/.filebot
java.class.path: /usr/share/filebot/FileBot.jar
sun.java.command: /usr/share/filebot/FileBot.jar -script fn:sysenv
sun.cpu.isalist: 
user.name: jeroen


# Arguments #
args[0] = -script
args[1] = fn:sysenv


Done ヾ(@⌒ー⌒@)ノ
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

When i typ:

Code: Select all

ls -l /media
This is the result:

drwxr-x---+ 2 root root 4096 mrt 4 09:58 jeroen
drwxr-xr-x 2 root root 0 feb 16 20:09 NAS
drwxr-xr-x 2 root root 4096 mrt 3 14:34 windowsshare
drwxr-xr-x 2 root root 4096 mrt 3 12:46 winshare01

I can't manage to change the ownership or the rights for user/groups. I can't even copy a file to the NAS myself since root is the owner. So that is the problem.

But i also mounted the same share in another way. This way i have all permissions, so if you just tell me how i could set this as outputfolder my mission is also accomplished:

smb://nas/public/videos

(and yes, i made a small donation for all the hassle :) )
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

Allready fixed it. Mounted the drive again with all rights for group en users.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: deluge/Vuze script in Linux

Post by rednoah »

By log, I meant filebot --log-file. So you've never actually looked at any of the logs? Well, randomly trying things is certainly not the most effective way of solving problems, but I'm glad you got lucky. :D
:idea: Please read the FAQ and How to Request Help.
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: deluge/Vuze script in Linux

Post by Calcky82 »

haha. Yeah. I Know. Just wanted to make it work. :)
Post Reply