Android, Remote Only Client

Suggestions and discussion of future versions
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Hi Damoxc,

Here is the first version that supports Deluge. Can you take a look at it and see if it works for you? Your 1.2 Deluge web ui should be running and connected(!). Download at http://ekok.nl/download/transdroid-0.7.0.apk (The outside version number is the same, but it will override any possible previous installs nicely.)

Everything should work, so let me know if it doesn't. Thanks!
Eric
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

Yup works great!

Just a couple of suggestions:
  • Allow the pop up message saying the list has been refreshed to be switched off
  • Allow for a faster refresh time than 5 seconds, perhaps an "Other"

Good work though :)
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Good suggestions. I'll add them to the next release.

You might get some questions from people asking about when 1.2 will be released. I published Transdroid with Deluge 1.2 support to the market for early adapters. :-)
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Hi agina,

How is the progress on Deluge 1.2? In the meantime, the Deluge-supporting Andorid client is on the market for some time now. Not sure about how many actually use the Deluge daemon with it though, but I guess you do. :-)

I am trying to implement the 'uploading' of .torrent files to the Deluge daemon now using the JSON API. The method list mentions an add_torrent_file_binary method. But is this also available when using the Web UI JSON API? Since sending raw bytes as JSON-encoded strings seems troublesome...

I have to admit I haven't tried it yet, but will this actually work? Thanks!
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

Nope, you need to upload the file to the webserver (via a HTTP post to /upload, and the contents of the resulting page is the filename on the server of the file you just uploaded), and then call web.add_torrents via json.

Code: Select all

@export
def add_torrents(self, torrents):
    """
    Add torrents by file
    
    :param torrents: A list of dictionaries containing the torrent
    path and torrent options to add with.
    :type torrents: list
    
    **Usage**
    >>> json_api.add_torrents([{
            "path": "/tmp/deluge-web/some-torrent-file.torrent",
            "options": {"download_path": "/home/deluge/"}
        }])
    """
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Thanks... again! I have it working now and it will be in the next release.
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

I'm going to be making it so you must be authenticated before making a json request which I believe will break your client? Thought I'd just let you know 8-)
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

Righty, this has been implemented now, you need to call "client.web.login" which if successful will add a set-cookie header to the response containing _session_id and return True.

You'll have to include this cookie in further requests otherwise you'll receive not authenticated errors.
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Thanks for letting me know! I will update my client soon.
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Hey damoxc,

I have taken a look at this, but confused about what to do. I used to use the auth.login method, which worked fine. I send the password with this request.

Now, I have checked out the latest version of Deluge from the trunk, and this (old?) method now gives:

Code: Select all

{"id": 1, "result": true, "error": null}
However, I do not get authenticated, which I guess is by design:

Code: Select all

{"id": 2, "result": null, "error": {"message": "Not authenticated", "code": 1}}
So I tried calling client.web.login and also web.login but both give a response:

Code: Select all

{"id": 2, "result": null, "error": {"message": "Unknown method", "code": 2}}
Any ideas? deluged won't give me any error messages, even when started with 'deluged -L debug -d'.

Thanks!
Post Reply