For my Transmission Android client (called Transdroid), I am using the RPC JSON-API. I am trying to add a new feature, allowing to upload the contents of a local .torrent file to the server daemon. (This is used for example on website that have password-protected .torrent files. When you send such URL's to transmission, it doesn't know how to retrieve them from the internet since it has no username/password to authenticate with.)
The problem is that Transmission keeps giving me an error response:
Code: Select all
{"method":"Add","arguments":{},"tag":0,"result":"invalid or corrupt torrent file"}
What I am sending is the contents of a .torrent file that is base64-encoded. The full request as a text file
can be downlaoded here (the base64-encoded string is quite big and I can't upload .txt files here). Basically, it looks like:
Code: Select all
{"method":"torrent-add","arguments":{"metainfo":"<the encoded string>"},"tag":0}
This .torrent file I have encoded is an Ubuntu torrent.
Any ideas on why this torrent is rejected?
Here is the Java base64-encoder that I use (but I have the same issue with several other encoders). Hope you can help me!