This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Web ui 3.2 - uploading torrent programmatically

Tags: None
(comma "," separated)
DarkFlare
Registered Member
Posts
1
Karma
0
Hi

I am trying to upload a torrent to the web gui programmatically using java.

Currently i have figured out that i need to make a multipart form object and attach a file named "load torrent" and post it to the address of /torrent/load?page=interface.html

my issue is authenticating. Usually for other web ui's i just use the httpclients "set creditencials" however in this instance its not doing the trick.

Looking at the login.js and having a dig around has shown me that there is something called a challenge, and that the password is encrypted?

Could anyone help me with how i might program the authentication to be able to post to /torrent/load?page=interface.html?

Thanks

DF
George
Moderator
Posts
5421
Karma
1
DarkFlare wrote:Hi

I am trying to upload a torrent to the web gui programmatically using java.

Currently i have figured out that i need to make a multipart form object and attach a file named "load torrent" and post it to the address of /torrent/load?page=interface.html

my issue is authenticating. Usually for other web ui's i just use the httpclients "set creditencials" however in this instance its not doing the trick.

Looking at the login.js and having a dig around has shown me that there is something called a challenge, and that the password is encrypted?

Could anyone help me with how i might program the authentication to be able to post to /torrent/load?page=interface.html?


The challenge is a random string, generated by the server, to protect the password.

The challenge field and the password field are concatenated and then hashed with SHA1. Then the value to the challenge field is set to the hash and the value of the password is cleared. Finally the login form is posted with these modifications. The hash needs to be correct before login is successfull.

So you will have to do the same thing, to login. As a result of the login, you will get a cookie which you can then use in /torrent/load.
Lain_13
Registered Member
Posts
103
Karma
0

Wed Apr 15, 2009 1:09 pm
George
Now I understand why I can't login using "Secure Login" extension in firefox in forced to enter login info. manually. I propose to use https for everything instead of http and use normal methods to send password to server.


What isn`t remembered never happened. Memory is merely a record. You just need to rewrite that record.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft