Pidgin/libpurple interface

Suggest, post, or discuss plugins for Deluge
ggaspari

Pidgin/libpurple interface

Post by ggaspari »

Hi, I have a suggestion...

Create a pidgin plugin or even incorporate libpurple itself as the plugin so we could control Deluge with simple text commands. absolutely zero fiddling with IPs, blocked ports and whatnot. Just create a MSN or Jabber/gtalk username for your program and IM it from work, your cell phone, the library, anything!

A mockup of the menus and commands:

-----------------------
DelugeIM Plugin V0.0001
3 transfers running, 732 connections, 102.4K down, 58.9K up
input command (type Help for command list)

you> add http://www.foobar.org/foo/whatever.torrent

Adding http://www.foobar.org/foo/whatever.torrent
Download successful, starting transfer
4 transfers running, 840 connections, 153K down, 60K up

you> status

Choose 0ne of the following transfers for detailed status report:
1) Ubuntu-9.04.iso
2) Fedora.iso
3) Mandriva.iso
4) whatever

you>4

Whatever size: 803Mb, downloaded 80.2Mb (9.9%), download speed XXX, hh:mm:ss time to complete

---------------------------------------------------
Other possible commands: Pause (number), pause all, reboot/shutdown the computer (default to disabled due to security reasons), delete torrents (not sure about this one either), set/override speed limits. Basically it would be a way to issue simple commands without having to deal with a full web server.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Pidgin/libpurple interface

Post by johnnyg »

This has been discussed before (on IRC) and a jabber ui would indeed be awesome.
That said, there has been no date set for implementing it (it's more on the wish list rather than the todo list).
raul.gigea
New User
New User
Posts: 3
Joined: Mon May 25, 2009 8:33 pm

Re: Pidgin/libpurple interface

Post by raul.gigea »

Hi,

i was looking for something like that as well. Didn't find anything so i decided to code it myself.

I didn't use libpurple tough, since its a bit of an overkill. Insted I used a pythonian alternative - Twisted Words.

My focus was rather the "notification by IM" part, because controlling it can be done trough the WebUI, but having the Jabber Code there i said - "eeeh, what the hell, lets do it" . That said, the command set of the jabber bot is a little limited:
  1. status - Prints current status information about all downloading torrents
  2. add [URL of Torrent] - Gets Torrent File from URL and starts downloading
  3. del [Id of Torrent] - Deletes Torrent File with given Id
  4. help - This command
Features:

The status of all the downloads is updated every 10 seconds in the contact "away/status message bubble".
Only Buddies(Authorized JIDs) can send Deluge Commands to Bot.
It sends an Instant Message upon completion of any Download.
It also has Mail Notifications implemented as a Core Plugin, since the included Deluge Mail Notification works only with the GTK UI on.
Adding, Removing of Torrents by sending IM message commands.

Use Instructions:
  1. compile code ( python setup.py bdist_egg )
  2. copy plugin into deluge plugin directory ( usually ~/.config/deluge/plugins )
  3. Create a Jabber account for your Bot ( register.jabber.org )
  4. Log on with your favourite IM Chat Application on both your and the Bot's accounts and manually authorize the Bot and viceversa. ( This isn't done by the plugin! ). Both Accounts should see the other one as online. Only Buddies(Authorized JIDs) can send Deluge Commands to Bot
  5. Start deluged & deluge webUI
  6. Enable RemoteNotify plugin ( Using WebUI at http://yourdelugedomain/config/plugins <- the ajax theme doesn't have this )
  7. Enter The Account&Passwords for your Bots jabber and Email account & save. ( http://yourdelugedomain/config/remotenotify )
  8. Restart deluged. ( Sadly, this is necessary because of a weird Twisted Words bug )
  9. Have phun chatting with your Deluge Jabberbot
The Code was hacked in about two days, so its pretty dirty.

Greetz
Attachments
RemoteNotify-0.1.tar.bz2
Remote Notification & UI Control by Jabber IM. Also core Mail Notifications.
(13 KiB) Downloaded 417 times
Last edited by raul.gigea on Mon May 25, 2009 9:22 pm, edited 1 time in total.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Pidgin/libpurple interface

Post by johnnyg »

awesome, I'm assuming this is written for 1.1.8?

also, make sure you add it to: http://dev.deluge-torrent.org/wiki/Plugins
raul.gigea
New User
New User
Posts: 3
Joined: Mon May 25, 2009 8:33 pm

Re: Pidgin/libpurple interface

Post by raul.gigea »

oh, 1.1.8 is out ... i see. Next release of the plugin is coming sooner than i tought :D

No, it was for 1.1.7. I hope not much is changed, i'll go right at it and port it to the new api.
raul.gigea
New User
New User
Posts: 3
Joined: Mon May 25, 2009 8:33 pm

Re: Pidgin/libpurple interface

Post by raul.gigea »

lucky. it worked ootb with 1.1.8. Also added to wiki
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Pidgin/libpurple interface

Post by johnnyg »

yes 1.1.7 and 1.1.8 have no differences in terms of plugin api.
the comment was more referring whether it was for 1.1.x or 1.2 which has a very different api.
goat
New User
New User
Posts: 4
Joined: Sat Jan 31, 2009 8:11 am

Re: Pidgin/libpurple interface

Post by goat »

Hi,

I'm running 1.1.9r and running into the following problem when initially attempting to access the plugin to configure it via the webui:

Fault : <Fault 1: '<type \'exceptions.Exception\'>:method "remotenotify_get_config" is not supported'>

This is the traceback:

Code: Select all

--Deluge Error--
Fault : <Fault 1: '<type \'exceptions.Exception\'>:method "remotenotify_get_config" is not supported'>
path : /config/remotenotify
file : /var/lib/python-support/python2.6/deluge/xmlrpclib.py in close, line 786

--Input--
<Storage {}>

--Versions--
WebUi : 1.1.9r
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18) 
[GCC 4.3.3]:

--Traceback--
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/webapi.py", line 310, in wsgifunc
    result = func()
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/var/lib/python-support/python2.6/deluge/ui/webui/page_decorators.py", line 87, in deco
    return func(self, name) #check_session:ok
  File "/var/lib/python-support/python2.6/deluge/ui/webui/page_decorators.py", line 105, in deco
    return func(self, name) #check_connected:ok
  File "/var/lib/python-support/python2.6/deluge/ui/webui/page_decorators.py", line 60, in deco
    res = func(self, name) #deluge_page_noauth
  File "/var/lib/python-support/python2.6/deluge/ui/webui/config_forms.py", line 88, in GET
    f = form_class()
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/newforms_plus.py", line 84, in __init__
    data = self.initial_data()
  File "build/bdist.linux-x86_64/egg/remotenotify/webui.py", line 53, in initial_data
    data = sclient.remotenotify_get_config()
  File "/var/lib/python-support/python2.6/deluge/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/var/lib/python-support/python2.6/deluge/xmlrpclib.py", line 1440, in __request
    verbose=self.__verbose
  File "/var/lib/python-support/python2.6/deluge/ui/client.py", line 93, in request
    return self._parse_response(h.getfile(), sock)
  File "/var/lib/python-support/python2.6/deluge/xmlrpclib.py", line 1343, in _parse_response
    return u.close()
  File "/var/lib/python-support/python2.6/deluge/xmlrpclib.py", line 787, in close
    raise Fault(**self._stack[0])



Any other information desired? Does the plugin need to be patched?

Regards,
-Tim
pdoes
New User
New User
Posts: 5
Joined: Mon Dec 08, 2008 2:33 pm

Re: Pidgin/libpurple interface

Post by pdoes »

It needs a patch, don't know how, but I have a workaround :)

Create a directory in the root.
/config
Make sure it is writeable by the user that runs the deluged and deluge.
That will make it work.
SadLittleGirl

Re: Pidgin/libpurple interface

Post by SadLittleGirl »

I would really like a working version of this plugin!

Unfortunately it does not work with all versions I tested it. But even if it would work, some things are just ridiculous: Why do I _have to_ specify a mail address as well as a Jabber ID? I only want to be notified via Jabber - mail should be optional!
Why is it not possible to configure the plugin from within Deluge? The webui-configuration step is not possible with the new version of Deluge?

Windows support has to be improved immensely! It is not possible to get it running; I tried it with Ubuntu as well, but I was not once able to have "phun" with my Jabberbot!

Please improve it, thank you.
Post Reply