• Copy this script and use your favourite text editor to save it somewhere.
• Download this script: http://libtorrent.rakshasa.no/downloads ... _resume.pl and put it somewhere.
• Dive into a terminal and "chmod +x" both of these files.
• Do the following for the perl script to work: sudo perl -MCPAN -e 'install Convert::Bencode'
• Configure the configurable things in the script. They're all important so don't miss one.
• Ensure you have fully completed torrents in Deluge. Any half-completed (like one episode from a series) or still downloading torrents will not be ported to rTorrent, but will still have their .torrent files removed from Deluge's session directory!
• Ensure rTorrent is setup as you would like. You basically just need the watch folder setup. Any other stuff like ruTorrent can wait if you want.
• Run the script from the command line. You'll get a bunch of output as rtorrent_fast_resume.pl adds fast_resume data to all your torrent files.
• All your Deluge torrent files are now in rTorrent's watch folder and have been added if rTorrent was running!
• Go to Deluge and remove (without data!!) all your torrents.
• Go to Preferences --> Plugins. Turn on Execute: http://cl.ly/EnBh
• Restart deluged.
• Go to Preferences --> Execute. Do your version of this (i.e. enter the path to this script!): http://cl.ly/EnOO Click Apply/Okay/etc.
• Optionally change "backup=yes" to "backup=no"
• Optionally enter a cronjob to clear out rTorrent's watch folder for .torrent files every 24 hours: "crontab -e" and enter "0 0 * * * rm $HOME/path/to/rtorrent/watch_folder/*.torrent > /dev/null 2>&1" – unadvisable if you have schedule start_tied set.
• Add a torrent to Deluge and test it!
In order to not have to start using two different web-interfaces, you could start using this UserScript to add torrents to Deluge (and hence rTorrent) with minimal effort (works on private trackers too) (use it with NinjaKit for Safari): http://userscripts.org/scripts/show/79003
Code: Select all
#!/bin/bash
####################################################################
### Please fill in the variables below! ###
####################################################################
# Default is "deluge", but you should have changed it...
password=deluge
# Your domain/IP here. For example, google.com or localhost or 127.0.0.1
domain=localhost
# The port you use to access the WebUI (default 8112)
port=8112
# Do you use http or https to access the WebUI (default http)?
scheme=http
# Which folder are you keeping rtorrent_fast_resume.pl in?
# Please include trailing slash.
dir=$HOME/torrents/
# Where do your torrents eventually download to? If they auto-move
# please specify that directory. Please include trailing slash.
download=$HOME/torrents/complete/
# rTorrent's watch folder. Please include trailing slash.
watch=$HOME/torrents/watchr/
# Do you want to backup whatever's in Deluge's state directory before
# rm'ing it all? (Useful the first time for the mass-transfer but
# probably not afterward).
backup=yes
# Do not change this unless you have knowingly changed Deluge's
# state folder.
files=$HOME/.config/deluge/state/
### ###
# This script is designed to be used alongside the Execute plugin! #
### ###
###################################################################
### Please remember to create the watch folder for rTorrent! ###
### Please remember to have rTorrent fully setup and config'd! ###
### Remember to chmod +x this script and the perl script! ###
###################################################################
# Backup if you told it to.
date=`date +"%m-%d-%Y-%H.%M.%S"`
if [ "$backup" = "yes" ]; then tar -cf $HOME/deluge_state.$date.tar $files; fi
# Every torrent, "f", will have fastresume data added and then moved
# to rTorrent's watch directory, "watchr" for addition.
# $1,$2 received from Execute plugin. Need specifics when not en masse.
# If block ensures these lines don't run except via Execute plugin.
# Authenticating to deluge-web.
# Remove torrent using $1 var passed from Execute.
if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
torrentid=$1
torrentname=$2
torrentpath=$3
perl $dir/rtorrent_fast_resume.pl "$torrentpath" < "$files/$torrentid.torrent" > "$watch/$torrentname.$RANDOM.torrent"
cookie=`curl -vskm 1 -H "Content-Type: application/json" -X POST -d "{\"id\": 1,\"method\": \"auth.login\",\"params\": [\"$password\"]}" $scheme://$domain:$port/json 2>&1 | grep -i "Set-Cookie:" | cut -d '=' -f2 | cut -d ';' -f1`
curl -vskm 1 -b _session_id=$cookie -H "Content-Type: application/json" -X POST -d "{\"method\":\"core.remove_torrent\",\"params\":[\"$1\",false],\"id\":2}" $scheme://$domain:$port/json
else
for f in $files/*.torrent
do
name=`basename $f`
perl $dir/rtorrent_fast_resume.pl $download < $f > $watch/$name
rm $f
done
fi