Possible to move torrents when share ratio is reached

General support for problems installing or using Deluge
Post Reply
GyroTech
New User
New User
Posts: 9
Joined: Tue Dec 25, 2007 10:33 am

Possible to move torrents when share ratio is reached

Post by GyroTech »

Hi all,

I'm trying to set up a system where I had one folder for active downloads, another folder for seeding downloads, and a third one for when seeding has stopped. The first two are easy to do as Deluge already has "Download to:" and "Move completed to:", but the third one I can't seem to find a way of doing it.
I have my Deluge set up to seed to a ratio of 2.0 and then remove the torrent when it hits the ratio, an I tried using the Execute plugin, but "Torrent Complete" means that the torrent has completed downloading and still probably needs to seed for a while so at best I can duplicate the file rather than move it.

Does anyone know of a setup where this can be done?

Many thanks,

GyroTech
mawvius
New User
New User
Posts: 2
Joined: Tue Jun 19, 2018 1:10 pm

Re: Possible to move torrents when share ratio is reached

Post by mawvius »

This has been requested many time before:

viewtopic.php?f=9&t=54189&p=228340#p228340
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Possible to move torrents when share ratio is reached

Post by mhertz »

Just wanted to add that this could be accomplished by selecting both a ratio and the option for removing torrent afterwards, and then using the execute plugin with event 'Torrent removed' and using for script:

Code: Select all

#!/bin/bash

mv "$3/$2" ~/finished
Change '~/finished' to whatever destdir wanted.

You can also do selective moving based on content(file-extensions) like LabelPlus plugin does with it's autolabels functionality, and e.g this is what I use, but you probably wan't to amend it somewhat to your needs, as I prefer skipping any possible "top-dirs" and just moving the video files over(as sorting gets messed up with episodes when some are in dirs and others not, and I delete video when seen so not having a big archive anyways) + retrieving subs and deleting samples if any. I only use torrenting for video currently, so add sections for other types you use like music, apps, ebooks etc: (I use this instead of LabelPlus because it didn't support magnets previously, though i've fixed that recently and because I can do the extra things also described previously, with this)

Code: Select all

#!/bin/bash

if [ -d "$3/$2" ]; then
	find "$3/$2" -type f \( -iname "*sample*.avi" -o -iname "*sample*.mp4" -o -iname "*sample*.mkv" \) -delete
	find "$3/$2" -type f \( -iname "*.avi" -o -iname "*.mp4" -o -iname "*.mkv" \) -exec OpenSubtitlesDownload.py -l dan,swe,eng {} \;
	find "$3/$2" -type f \( -iname "*.avi" -o -iname "*.mp4" -o -iname "*.mkv" -o -iname "*.srt" -o -iname "*.idx" -o -iname "*.sub" \) -exec mv {} ~/video \;
	rm -rf "$3/$2"
else
	if [ ${2: -4} == ".mkv" ]; then
		mv "$3/$2" video
		OpenSubtitlesDownload.py -l dan,swe,eng "video/$2"
	elif [ ${2: -4} == ".mp4" ]; then
		mv "$3/$2" video
		OpenSubtitlesDownload.py -l dan,swe,eng "video/$2"
	elif [ ${2: -4} == ".avi" ]; then
		mv "$3/$2" video
		OpenSubtitlesDownload.py -l dan,swe,eng "video/$2"
	elif [ ${2: -4} == ".MKV" ]; then
		mv "$3/$2" video
		OpenSubtitlesDownload.py -l dan,swe,eng "video/$2"
	elif [ ${2: -4} == ".MP4" ]; then
		mv "$3/$2" video
		OpenSubtitlesDownload.py -l dan,swe,eng "video/$2"
	elif [ ${2: -4} == ".AVI" ]; then
		mv "$3/$2" video
		OpenSubtitlesDownload.py -l dan,swe,eng "video/$2"
	fi
fi
Post Reply