[Libtorrent-devel] Loading raw torrent data over xmlrpc with load_raw

Patrick ''Eatingdogs'' Armstrong eatingdogs at gmail.com
Thu Apr 3 07:50:11 UTC 2008


Hi. I've been writing yet-another-frontend for rtorrent, and I've been
trying to load some raw torrent data.
I'm using an Ubuntu torrent as a test, and I'm having trouble loading the
raw data. My original plan was to read the torrent data into a variable,
then use the value of that variable as a parameter. I then looked over the
XMLRPC spec, and it seemed to imply that binary data needs to be formatted
in base64, so I tried that. None of these worked. Here's a quick test
program to show my shame:

#!/usr/bin/ruby

require 'xmlrpc/client'
require 'base64'

server = XMLRPC::Client.new("localhost")

f = File.open(ARGV[0], "r")
torrent_data = f.read
puts server.call("load_raw_verbose", Base64.encode64(torrent_data))
puts "===================================="
puts server.call("load_raw_verbose", torrent_data)


This gives the following output:

patricka at snark:~$ ./rtorrent.rb ubuntu-8.04-beta-desktop-i386.iso.torrent
0
====================================
/usr/lib/ruby/1.8/xmlrpc/client.rb:414:in `call': Call XML not a proper
XML-RPC call.  Call is not valid XML.  not well-formed
(XMLRPC::FaultException)
from ./rtorrent.rb:13


I'm not really sure what I'm doing wrong here. Any tips?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rakshasa.no/pipermail/libtorrent-devel/attachments/20080403/e16e998a/attachment.html


More information about the Libtorrent-devel mailing list