Need help with Deluge execute script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
aberg83
Posts: 1
Joined: 23 Mar 2015, 22:56

Need help with Deluge execute script

Post by aberg83 »

I'm trying to get the attached script to work but I'm stuck. Any help would be appreciated!

Code: Select all

#!/bin/bash
# Script to be executed by Deluge on seedbox when torrent downloads complete which organizes files using filebot and uploads to SFTP site

# Variables
login=xxxxxx
pass=xxxxxx
host=sftp://www.xxxxxx.com:xxxx
remote_dir="/remote/path/to/Complete"
local_dir="/local/path/to/Complete"

# Get arguments from Deluge
torrent_name=$2
torrent_path=$3

# Run FileBot on completed torrent download to extract, rename and hardlink into 'Complete' directory
filebot -script fn:amc --output "$local_dir" --log-file amc.log --action hardlink --conflict override -non-strict --def music=y artwork=y "ut_dir=$torrent_path/$torrent_name" "ut_kind=multi" "ut_title="

# Lock upload
trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM
if [ -e /tmp/synctorrent.lock ]
then
  echo "Synctorrent is running already."
  exit 1
else
  touch /tmp/synctorrent.lock

# Upload 'Complete' directory to SFTP and remove source files when complete to save space on seedbox
  lftp -u $login,$pass $host << EOF
  set ftp:ssl-allow true
  set ftp:ssl-force true
  set mirror:use-pget-n 5
  mirror -R -c --Remove-source-files --log=upload_complete.log $local_dir $remote_dir
  quit
EOF

# Unlock upload
  rm -f /tmp/synctorrent.lock
  exit 0
fi
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need help with Deluge execute script

Post by rednoah »

You might be able to modify the amc script and write your own rename+upload rename function.

@see viewtopic.php?f=4&t=280#p7571
:idea: Please read the FAQ and How to Request Help.
Post Reply