Execute Shell Script On Completion Plugin?

Suggest, post, or discuss plugins for Deluge
eddieparker
Member
Member
Posts: 13
Joined: Mon Jan 14, 2008 7:10 pm

Execute Shell Script On Completion Plugin?

Post by eddieparker »

Hey!

I'm just wondering if this has been done before, or how hard it would be to implement.

Ideally I'd just like to get a shell script called upon a torrent being completed. Ideal things to get passed as parameters would be:

- Full path to download
- Label, if specified using said plugin

Might be nice to have options to have it fire a shell script on certain events, such as switching from leech->seed, when certain ratio requirements are met, etc.

Is such a thing easily doable with the plugin API? Or, better yet, has someone written something like this already?

Cheers,

-e-
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Execute Shell Script On Completion Plugin?

Post by johnnyg »

there has been talk about writing a plugin to do this - but nothing has been done on it yet.
In the meantime, may I ask what your shell script does? You might be able to whip up a temporary solution using ui client scripts.
You could also, for instance, have deluge move completed torrents to a specific directory and have cron run a script every so often on that directory.
eddieparker
Member
Member
Posts: 13
Joined: Mon Jan 14, 2008 7:10 pm

Re: Execute Shell Script On Completion Plugin?

Post by eddieparker »

Hey Johnny!

Well, I had a couple of thoughts about scripts I'd write with this information. Such as:

- Send e-mail notifications using the 'mail' command on linux.
- Send MSN/GTalk notifications
- Move files to specific folders (depending on their 'label')
- Anything else, really.

I'll take a look at the ui client scripts you mention, see if there's anything I can get from it. Thanks!
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Execute Shell Script On Completion Plugin?

Post by johnnyg »

eddieparker wrote: - Send e-mail notifications using the 'mail' command on linux.
- Move files to specific folders (depending on their 'label')
these will be in 1.1.0 (the first RC for it should be out very soon)
eddieparker wrote: - Send MSN/GTalk notifications
- Anything else, really.
not sure how easy it would be to send msn/gtalk notifications (or how useful?) however if you can do it in python then you would probably be able to write a ui client script in the meantime.
eddieparker
Member
Member
Posts: 13
Joined: Mon Jan 14, 2008 7:10 pm

Re: Execute Shell Script On Completion Plugin?

Post by eddieparker »

Awesome, thanks for the reply Johnny.
johnnyg wrote:
eddieparker wrote: - Send e-mail notifications using the 'mail' command on linux.
- Move files to specific folders (depending on their 'label')
these will be in 1.1.0 (the first RC for it should be out very soon)
Awesome. Will it be possible to move files across partition/hard-disk boundaries? I seem to recall there being a problem with that in past versions (or maybe that was a different client I used... memory is foggy.)
johnnyg wrote:
eddieparker wrote: - Send MSN/GTalk notifications
- Anything else, really.
not sure how easy it would be to send msn/gtalk notifications (or how useful?) however if you can do it in python then you would probably be able to write a ui client script in the meantime.
Well, allowing i could get an arbitrary shell script to execute on certain events from deluge, the MSN/GTalk stuff wouldn't be too bad I imagine - there's a bunch of libraries around for that sort of stuff, or so I've been told. As for it's effectiveness - well, who knows. Mostly just something I want to fiddle with - might lead to nothing. :)

I'll read more on the UI client scripts, but unfortunately I'll have to set aside some time to learn about the terminology. Is there a client script I can look at as an example for getting messages from events?
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Execute Shell Script On Completion Plugin?

Post by johnnyg »

eddieparker wrote:Well, allowing i could get an arbitrary shell script to execute on certain events from deluge, the MSN/GTalk stuff wouldn't be too bad I imagine - there's a bunch of libraries around for that sort of stuff, or so I've been told. As for it's effectiveness - well, who knows. Mostly just something I want to fiddle with - might lead to nothing. :)
no worries, just don't come crying if you accidentally broadcast to all your friends and family that you're downloading private stuff :P
eddieparker wrote:I'll read more on the UI client scripts, but unfortunately I'll have to set aside some time to learn about the terminology. Is there a client script I can look at as an example for getting messages from events?
That link I gave you contains all the documentation / example scripts that currently exist.
Feel free to post partial scripts here if you need any help.
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Execute Shell Script On Completion Plugin?

Post by damoxc »

I like the idea of this actually, and I think just executing a command upon completion could be useful. Could set your computer to shut down, for example via this.

I guess ./scriptname [torrent_name] [download_files_location] would suffice?
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Execute Shell Script On Completion Plugin?

Post by johnnyg »

andar was planning on writing this, not sure what happened, probably too busy with 1.2...
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Execute Shell Script On Completion Plugin?

Post by damoxc »

I'd imagine so, I'll have a look if I get the chance to do so before 1.2 is out.
eddieparker
Member
Member
Posts: 13
Joined: Mon Jan 14, 2008 7:10 pm

Re: Execute Shell Script On Completion Plugin?

Post by eddieparker »

Hey, that'll be awesome if you do!

The current SMTP plugin doesn't seem to work in my configuration, so shelling out to the 'mail' command might be an awesome work around.

Cheers,

-e-
Post Reply