On Mon, 24 Jul 2006 10:08:17 +0200, "Peter Van Biesen"
<[EMAIL PROTECTED]> said:
> Tracker wrote:
> > Peter Van Biesen wrote:
> >> 3) extend the rtorrent client with an API so external programs can get 
> >> information on what it is doing and possibly control it. This way, a 
> >> web interface could be written in php, cgi, ... that could interface 
> >> with that. A kind of console interface would be nice for scripting 
> >> purposes too.
> > The library is supposed to already have an API, why would the client 
> > application need one too?
> > While a scripting interface would be nice, I would prefer seeing the 
> > library wrappered in Python, PERL, Ruby, etc.
> 
> I disagree. Adding a console interface to rtorrent would be better as 
> you need a running process to seed or leech. The API od a running 
> instance of rtorrent offers entirely different functionality.
> 
>             API                           commands,...
> libtorrent <=> rtorrent ( torrentconsole ) <=> scripts, cgi,...
> 
> using the API would mean running a client for every instance of your 
> script, cgi, ... But indeed, it is just another way of IPC.
> 
> 
> But I'll elaborate. This is how it could look :
> 
> Starup your rtorrent client in a screen, detached. Configure its console 
> ( "API" ) to listen to port 54321 (e.g.).
> 
> $> telnet localhost 54321
> Welcome to the rtorrent console.
> Press "help" for a list of commands
> -> help
> start <torrentid>
> stop <torrentid>
> list
> details <torrentid>
> peers <torrentid>
> peerdetail <torrentid> <ip-addr>
> status
> 
> -> list
> 0 Betty_does_dallas.torrent 15% 753Mb
> 
> -> details 0
> Torrent       : Betty_does_dallas.torrent
> Completion    : 15%
> Size          : 753 Mb
> Files         :
>    Betty_does_dallas.avi
>    Betty_does_dallas.srt
> Peers         : 12
> Seeds         : 5
> Up speed      : 20 kbps
> Down speed    : 25 kbps
> 
> -> status
> Nr of torrents : 1
> Up speed       : 20 kbps
> Down speed     : 25 kbps
> 
> -> peers 0
> 172.16.0.123 45% 45kbps 10kbps
> 172.16.5.45 89% 5kbps 5kbps
> ...
> 
> and so on ... dumping everything in posix would make the parsing easier. 
> Cfr the SMTP protocol.
> 
> from scripts you could just do :
> telnet localhost 54321 <<!
> list
> exit
> !
> to get a list of all torrents running on that rtorrent instance. I don't 
> think it would dramatically complicate the client as it it just provides 
> hooks to already existing functions.
> 
> Just an idea.
> 
> Peter.
> 

I did something very similar to this just yesterday with BTQueue. The
PHP script would fire up a "btqueue.py remote" and then send it commands
and collect the replies. I could add remove start pause stop scrape and
anything else if it were added. The good thing about btqueue was it
would run as a daemon. So the PHP only opened a client during the
execution of the PHP. 

Is there a way to do something similar with rtorrent?
-- 
  Lloyd Bottomley
  v01d(AT)fastmail.fm

_______________________________________________
Libtorrent-devel mailing list
[email protected]
http://rakshasa.no/mailman/listinfo/libtorrent-devel

Reply via email to