Page 2 of 2

Re: Execute Shell Script On Completion Plugin?

Posted: Sat Mar 21, 2009 7:12 am
by luke16
Having the ability to launch scripts upon completion of torrents would be nice.
Basically what I want to have deluge be able to do is to have it automatically copy the torrents to another computer upon completion and then finish seeding to a certain ratio before deleting the file and removing the torrent. Problems with doing this using move torrent arise because I don't think that move torrent can move over networks, move torrent moves rather than copies, and the other computer isn't always on. So I basically need a script that launches when the torrent is complete, and then another one that launches after the torrent reaches a decent share ratio.

Re: Execute Shell Script On Completion Plugin?

Posted: Sat Mar 21, 2009 7:44 am
by eddieparker
If this helps anyone else, I've 'cheated' to get this functionality.

I've installed incrond on my linux box and basically set up 'watches' on my 'in progress' directory and my 'finished' directory, which sends e-mails when that occur. Naturally any script I write could do anything at that point.

I haven't figured out a way to get details like labels, seed info, or what not. Is there a way to pull this information out from deluge, via the command line? Might be nice to do once a script has finished.

Re: Execute Shell Script On Completion Plugin?

Posted: Mon Mar 23, 2009 12:42 am
by damoxc
What arguments would be useful to pass to the command, currently I have it passing torrent_id, torrent_name, torrent_path. I'm not sure what people will find the most useful. I guess in a later version could make the arguments that get passed configurable, but I'd like to keep it simple for the time being.

Re: Execute Shell Script On Completion Plugin?

Posted: Mon Mar 23, 2009 12:55 am
by eddieparker
damoxc wrote:What arguments would be useful to pass to the command, currently I have it passing torrent_id, torrent_name, torrent_path. I'm not sure what people will find the most useful. I guess in a later version could make the arguments that get passed configurable, but I'd like to keep it simple for the time being.
damoxc, you're my hero.

I'd hate to balloon the syntax of that script more than I have to, but for my usage the only thing I really would want above and beyond that is the 'labels' applied to the torrents. I plan on using labels as a way to differentiate where files get moved to once they're completed.

That said, those arguments might be useful enough if there's a way to query an active deluge daemon for the rest of the properties. Is there any way to do something like (pseudo-commandline): "deluge --torrent-id [x] --get-label", or some such? I think it would be cleaner to make your script as simple as possible and then support some sort of query mechanism, but I don't know how the architects of deluge feel about this.

Anyhow, to summarize: biggest thing for me is getting the 'label' associated with a torrent. I could see cases for other things (current seed ratio, etc, etc), but that'd probably be feature creep that might be better served by my second recommendation.

Re: Execute Shell Script On Completion Plugin?

Posted: Mon Mar 23, 2009 8:01 am
by damoxc
http://dev.deluge-torrent.org/wiki/Deve ... iClient1.2

You can write a simple client without too much difficulty, which is where the torrent id would come in use. I think configurable arguments will probably be the solution here, and shouldn't be too difficult to implement. I'll take a peek when I have a spare moment.

Re: Execute Shell Script On Completion Plugin?

Posted: Thu Apr 02, 2009 5:09 pm
by rokkk
hello ppl
i used torrentnotification plugin, added a line, that runs a script. works for me.

Re: Execute Shell Script On Completion Plugin?

Posted: Wed Apr 15, 2009 8:02 am
by DisasteR
rokkk wrote:hello ppl
i used torrentnotification plugin, added a line, that runs a script. works for me.
Hi

are you running the last version of deluge ?
did you use the move on complete feature ?

can you share your modification ?

Re: Execute Shell Script On Completion Plugin?

Posted: Tue Apr 28, 2009 4:50 am
by wen1987
Hello,

I find a simple solution. You can run deluged with log level debug, and then use grep to monitor the output. When a task completes, there should be some message looks like

Code: Select all

[DEBUG   ] 12:44:39 alertmanager:107 state_changed_alert: abc.tar.gz : state changed to: finished
. Then you can get more information using

Code: Select all

deluge -u console -a "info"