seshu0701 / transdroid

Automatically exported from code.google.com/p/transdroid
GNU General Public License v3.0
0 stars 0 forks source link

rTorrent support #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Can you please add rtorrent support. My NAS uses rtorrent and being able to
control it from my phone would be awesome.

Thanks,
SK

Original issue reported on code.google.com by nospamno...@gmail.com on 8 May 2009 at 9:57

GoogleCodeExporter commented 8 years ago
Sorry, didn't know how to open this as an Enhancement.

Original comment by nospamno...@gmail.com on 8 May 2009 at 9:58

GoogleCodeExporter commented 8 years ago
Thanks for you interest. rTorrent does seem to have a RPC interface, although 
it's
not JSON-based. I will look into it.

Original comment by erickok@gmail.com on 8 May 2009 at 10:09

GoogleCodeExporter commented 8 years ago

Original comment by erickok@gmail.com on 8 May 2009 at 11:14

GoogleCodeExporter commented 8 years ago
Users of rtorrent will define an XMLRPC url in their rtorrent.rc. This defaults 
to
localhost/RPC2.

Once configured, the rpc server sits at that url, and will wait for messages. 
To get
a list of downloading torrents, for example, you raise 'download_list started', 
which
gives you a list of hashes back (of the started downloads). You can then query
information per hash (p.get_url ###############).

The RPC also has a command 'list_commands', which obviously gives you the full 
list
of commands.

More can be found here: http://libtorrent.rakshasa.no/wiki/RTorrentXMLRPCGuide

An android library for interfacing with XMLRPC can be found here:
http://code.google.com/p/android-xmlrpc/

Hopefully that should be enough for this to get started on!

Original comment by keitha...@gmail.com on 11 May 2009 at 11:00

GoogleCodeExporter commented 8 years ago
Hey that great. Saves a lot of work. I will try to do this asap, but I'm pretty 
busy.

Eric

Original comment by erickok@gmail.com on 11 May 2009 at 1:01

GoogleCodeExporter commented 8 years ago
Preliminairy support for rTorrent is now available in Transdroid 0.8.0 (you 
might
need have wTorrent running as well).

PLEASE let me know if it is working for you.

Original comment by erickok@gmail.com on 2 Jun 2009 at 1:24

GoogleCodeExporter commented 8 years ago
Had a little trouble connecting, as I was putting a more explicit server string 
(with
the HTTP and RPC2 parts of the url included), but thats another issue.

Once I realised to omit those parts (browsed the source code) it worked 
straight away.

There are a lot of issues with the integers. I don't quite understand why it 
does it,
but I'll end up with a bunch of negative integers. An example is that one of my
torrents is 72% complete, which registers on Trainsdroid as -238.5%. This 
torrent
also has an empty progress bar in Trainsdroid.

Another torrent which registers the percentage at 42.5% (while rtorrent 
registers at
51%). From what I can see this number decreases, so I presume it is somehow 
counting
remaining percent, rather than percent done. displays "-653226017 B of 
-1543598113
B", which is obviously wrong. (Rtorrent reports "3482.2 / 6719.9 MB". This same
torrent reports -23823s remaining. It also says "15  of 15 peers" while 
rtorrent says
15/196 (6), I guess this is because in your code you've set them all to info[5].
The "completion" bars are also a bit off. For the majority of torrents they 
look to
be about 10% behind, for one which is 72% the progress bar is empty, and another
torrent at 27% the progress bar is full.

I guess a quick fix would be to either register the ints as unsigned (which I 
beleive
is possible in Android, IANAE), or to check against ints that are < 0 and 
perhaps
just change them to "Unknown".

In the meantime, I'll look at what my RPC server spits out, to see if it is a 
server
problem. I am guessing not though, as the web interface gets it right.

Hopefully this doesnt sound like a rant! I'm just interested in getting this 
bugs fixed!

Original comment by keitha...@gmail.com on 3 Jun 2009 at 9:11

GoogleCodeExporter commented 8 years ago
Thanks for testing Transdroid's rTorrent support. I had some troubles getting
rTorrent to run myself, so testing was a little difficult. (I'm only happy 
people
actually want to use this. :-) )

I tested now with my rTorrent and indeed the % values were a bit off (albeit not
negative). I've made a fix that hopefully will solve this issue in the next 
relese,
0.8.1. It will now use 'd.get_bytes_done / d.get_size_bytes'.

I have no idea where the 'number of peers' values come from in the wTorrent
interface. Haha. I guess I should ask some developer, since I wasn;t able to 
find the
actual rTorrent fields/functions they use for this. I use 
'd.get_peers_connected' and
'd.get_peers_not_connected', but I guess there should be others... 

Original comment by erickok@gmail.com on 3 Jun 2009 at 12:53

GoogleCodeExporter commented 8 years ago
Added an option to manually set the SCGI folder. Although the number of
seeders/leechers is still off, I close this issue for now since rTorrent 
support is
actually now available.

Original comment by erickok@gmail.com on 16 Jun 2009 at 3:17

GoogleCodeExporter commented 8 years ago
Excellent app.  Thank you.  Please keep developing it ;-)

Original comment by peterdub...@gmail.com on 5 Jul 2009 at 6:24

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
There is an issue regarding the return types of the xmlrpc call [1]. Depending 
on 
the xmlrpc-c version used on the server, numbers are returned as Long or 
Integer (I 
assume). I've only tried the latest version of the app with xmlrpc-c-1.18.02 
and in 
RTorrentAdapter.java [2] there is a ClassCastException thrown and the classes 
of the 
numbers is actually Long (but the code casts to Integer).

When replacing all casts to Integer with Long (actually, 
((Long)info[x]).intValue) 
it works for me again. Maybe this also is the reason for the negative values 
described in comment 7?

A possible fix is to cast according to the type given in Object.getClass() or 
similar.

[1] http://libtorrent.rakshasa.no/ticket/1779  (saying that long is supported 
since 
xmlrpc-c-1.07)
[2] http://code.google.com/p/transdroid/source/browse/trunk/src/org/transdroid/
daemon/Rtorrent/RtorrentAdapter.java#204

I am using:
 xmlrpc-c-1.18.02
 rtorrent-0.8.4/libtorrent-0.12.4

Original comment by rschilter on 31 Jul 2009 at 4:06

GoogleCodeExporter commented 8 years ago
Thanks rschilter. There is actually a seperate issue for this: issue 31

I copied your reply there. Unfortunately I can't get any version of xmlrpc-c to
compile on my Ubuntu box. :-( 

Original comment by erickok@gmail.com on 17 Aug 2009 at 12:51