dippynark
dippynark

Reputation: 3003

Unable to load torrent file using raw base64 form and python xmlrpc client

I am trying to load a torrent file into rtorrent using xmlrpc with the following python3 code:

import xmlrpc.client

server_url = "https://%s:%s@%s/xmlrpc" % ('[REDACTED]', '[REDACTED]', '[REDACTED]');
server = xmlrpc.client.Server(server_url);

with open("test.torrent", "rb") as torrent:
    server.load.raw_verbose(xmlrpc.client.Binary(torrent.read()),"d.delete_tied=","d.custom1.set=Test","d.directory.set=/home/[REDACTED]/files")

The load_raw command returns without an error (return code 0), but the torrent does not appear in the rutorrent UI. I seem to be experiencing the same thing as from this reddit post, but I am using the Binary class without any luck.

I am using a Whatbox seedbox.

EDIT:

After enabling logging I am seeing

1572765194 E Could not create download, the input is not a valid torrent.

when trying to load the torrent file, however manually loading the torrent file through the rutorrent UI works fine.

Upvotes: 2

Views: 468

Answers (1)

dippynark
dippynark

Reputation: 3003

I needed to add "" as the first argument:

server.load.raw_verbose("",xmlrpc.client.Binary(torrent.read()),"d.delete_tied=","d.custom1.set=Test","d.directory.set=/home/[REDACTED]/files")

Not sure why, the docs don't seem to show this is needed.

Upvotes: 3

Related Questions