stil4m / transmission-rpc-java Goto Github PK
View Code? Open in Web Editor NEWJava implementation of the Transmission RPC API.
Java implementation of the Transmission RPC API.
When I first used it, there was a JSON parsing error on TorrentInfo.rateDownload
.
so I added a annotation to make it work .(@JsonProperty("rateDownload (B/s)"))
but now , function getAllTorrentsInfo
return torrentInfo.rateDownload is empty.
This is also the case for the rateUpload
How to solve it,please
Hi,
Issue is reproduced due to sending the POST request to add the torrent file.
`
2018-02-07 12:24:51 DEBUG DefaultClientConnection:274 - Sending request: POST /transmission/rpc HTTP/1.1
2018-02-07 12:24:51 DEBUG wire:73 - >> "POST /transmission/rpc HTTP/1.1[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - >> "Content-Length: 99[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - >> "Content-Type: text/plain; charset=UTF-8[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - >> "Host: localhost:9091[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - >> "Connection: Keep-Alive[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - >> "User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_151)[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - >> "[\r][\n]"
2018-02-07 12:24:51 DEBUG headers:278 - >> POST /transmission/rpc HTTP/1.1
2018-02-07 12:24:51 DEBUG headers:281 - >> Content-Length: 99
2018-02-07 12:24:51 DEBUG headers:281 - >> Content-Type: text/plain; charset=UTF-8
2018-02-07 12:24:51 DEBUG headers:281 - >> Host: localhost:9091
2018-02-07 12:24:51 DEBUG headers:281 - >> Connection: Keep-Alive
2018-02-07 12:24:51 DEBUG headers:281 - >> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_151)
2018-02-07 12:24:51 DEBUG wire:87 - >> "{"method":"torrent-add","arguments":{"filename":"/mnt/32g/torrentConnector/file0.torrent"},"tag":1}"
2018-02-07 12:24:51 DEBUG wire:73 - << "HTTP/1.1 401 Unauthorized[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - << "Server: Transmission[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - << "WWW-Authenticate: Basic realm="Transmission"[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - << "Date: Wed, 07 Feb 2018 12:24:51 GMT[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - << "Content-Length: 43[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - << "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2018-02-07 12:24:51 DEBUG wire:73 - << "[\r][\n]"
2018-02-07 12:24:51 DEBUG DefaultClientConnection:259 - Receiving response: HTTP/1.1 401 Unauthorized
2018-02-07 12:24:51 DEBUG headers:262 - << HTTP/1.1 401 Unauthorized
2018-02-07 12:24:51 DEBUG headers:265 - << Server: Transmission
2018-02-07 12:24:51 DEBUG headers:265 - << WWW-Authenticate: Basic realm="Transmission"
2018-02-07 12:24:51 DEBUG headers:265 - << Date: Wed, 07 Feb 2018 12:24:51 GMT
2018-02-07 12:24:51 DEBUG headers:265 - << Content-Length: 43
2018-02-07 12:24:51 DEBUG headers:265 - << Content-Type: text/html; charset=ISO-8859-1
2018-02-07 12:24:51 DEBUG DefaultHttpClient:509 - Connection can be kept alive indefinitely
2018-02-07 12:24:51 DEBUG DefaultHttpClient:77 - Authentication required
2018-02-07 12:24:51 DEBUG DefaultHttpClient:107 - localhost:9091 requested authentication
2018-02-07 12:24:51 DEBUG TargetAuthenticationStrategy:175 - Authentication schemes in the order of preference: [Negotiate, Kerberos, NTLM, Digest, Basic]
2018-02-07 12:24:51 DEBUG TargetAuthenticationStrategy:204 - Challenge for Negotiate authentication scheme not available
2018-02-07 12:24:51 DEBUG TargetAuthenticationStrategy:204 - Challenge for Kerberos authentication scheme not available
2018-02-07 12:24:51 DEBUG TargetAuthenticationStrategy:204 - Challenge for NTLM authentication scheme not available
2018-02-07 12:24:51 DEBUG TargetAuthenticationStrategy:204 - Challenge for Digest authentication scheme not available
2018-02-07 12:24:52 DEBUG wire:87 - << "
I suppose the problem could be caused by the incorrect header of the http request. in method putSessionHeader.
Exception in thread "main" java.lang.NullPointerException at nl.stil4m.transmission.rpc.RpcClient.putSessionHeader(RpcClient.java:101) at nl.stil4m.transmission.rpc.RpcClient.setup(RpcClient.java:81) at nl.stil4m.transmission.rpc.RpcClient.execute(RpcClient.java:46) at nl.stil4m.transmission.rpc.RpcClient.executeWithHeaders(RpcClient.java:97) at nl.stil4m.transmission.api.TransmissionRpcClient.executeCommand(TransmissionRpcClient.java:88) at nl.stil4m.transmission.api.TransmissionRpcClient.addTorrent(TransmissionRpcClient.java:61) at com.epam.RSSTorrentConnector.TorrentClients.TransmissionClient.addTorrent(TransmissionClient.java:56) at com.epam.RSSTorrentConnector.RSSTorrentConnector.main(RSSTorrentConnector.java:31)
ENVIRONMENT:
Linux raspberrypi 4.9.59+ #1047 Sun Oct 29 11:47:10 GMT 2017 armv6l GNU/Linux
Transmission version: 2.92-2
Hello,
I'm using this call from a desktop computer to the delete a torrent with the downloaded files on my Raspberry Pi2 with Openelec:
client.removeTorrent(new RemoveTorrentInfo(new NumberListIds(id),true));
This removes the torrent files, but nothing happens with the downloaded files. The second boolean parameter is for deleting the local data, but maybe I misunderstood that.
What am I doing wrong? Maybe this is an transmission rpc problem? Thanks in advance!
Hello,
I'm thinking in use this library in a personal Project. What do you mean with PARTIALLY implementation in get and add methods?
And... Do you plan to continue with the development?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.