deluge-rpc 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +19 -12
- data/lib/deluge/rpc/connection.rb +9 -3
- data/lib/deluge/rpc/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fae94aca88e0cdf01efdc40596aea1d07b24d48d475f7302723bf82abdeb7a64
|
4
|
+
data.tar.gz: ffa497496c6caa1027eab7dde89a6676df48a34634344c109863cf974509f4b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f670476d2ab81393c6b0db0393293c1ca2e4db7c3170bf19c7d17d623e3596447b5e622b4ad5287e9dde8e4c38a3f027f7a909f608f35267788b65c05e9b442e
|
7
|
+
data.tar.gz: 4fde233a805d65cccde068bf7838a2407682902ecb88bb42e9d1454dd67f0153e94703a75d984fd62aa7337dc34b5bf8e1628e65d293e87133140e3a99a4cd76
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.3
|
data/README.md
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
# Deluge::RPC
|
2
2
|
|
3
|
-
Ruby RPC client library for Deluge 2.0+ torrent client.
|
4
|
-
Provides dynamic API bindings depending on RPC server.
|
3
|
+
Ruby RPC client library for [Deluge 2.0+ torrent client](https://deluge-torrent.org/).
|
4
|
+
Provides dynamic API bindings depending on RPC server.
|
5
5
|
Multi-threading friendly, thanks to ``concurrent-ruby`` gem.
|
6
6
|
|
7
|
-
Deluge 1.x is not supported anymore
|
7
|
+
*Deluge 1.x is not supported anymore*.
|
8
8
|
|
9
|
-
|
10
|
-
https://deluge.readthedocs.io/en/latest/reference/rpc.html
|
9
|
+
## Reference
|
11
10
|
|
12
|
-
|
13
|
-
https://deluge.readthedocs.io/en/latest/reference/api.html
|
11
|
+
* [Official RPC protocol documentation](https://deluge.readthedocs.io/en/latest/reference/rpc.html)
|
12
|
+
* [Deluge RPC API reference](https://deluge.readthedocs.io/en/latest/reference/api.html)
|
13
|
+
* [Official repository](https://github.com/deluge-torrent/deluge)
|
14
|
+
* Other client implementations:
|
15
|
+
[Go](https://github.com/gdm85/go-libdeluge),
|
16
|
+
[Python](https://github.com/JohnDoee/deluge-client)
|
14
17
|
|
15
18
|
## Usage
|
16
19
|
|
@@ -74,10 +77,10 @@ client.register_event(:torrent_removed) do |torrent_id|
|
|
74
77
|
end
|
75
78
|
```
|
76
79
|
|
77
|
-
Unfortunately there is no way to listen ALL events, due to Deluge architecture.
|
80
|
+
Unfortunately there is no way to listen ALL events, due to Deluge architecture.
|
78
81
|
You have to register each event you need.
|
79
82
|
|
80
|
-
**Keep in mind event blocks would be executed in connection thread, NOT main thread!**
|
83
|
+
**Keep in mind event blocks would be executed in connection thread, NOT main thread!**
|
81
84
|
Avoid time-consuming code!
|
82
85
|
|
83
86
|
### Known events
|
@@ -102,7 +105,7 @@ Avoid time-consuming code!
|
|
102
105
|
``PluginEnabledEvent`` | name | Plugin is enabled in the Core.
|
103
106
|
``PluginDisabledEvent`` | name | Plugin is disabled in the Core.
|
104
107
|
|
105
|
-
This list was extracted from Deluge 1.3.11 sources. Events for your version could be different.
|
108
|
+
This list was extracted from Deluge 1.3.11 sources. Events for your version could be different.
|
106
109
|
There is no official documentation.
|
107
110
|
|
108
111
|
Current events could be found here:
|
@@ -118,8 +121,12 @@ gem 'deluge-rpc'
|
|
118
121
|
|
119
122
|
And then execute:
|
120
123
|
|
121
|
-
|
124
|
+
```shell
|
125
|
+
$ bundle
|
126
|
+
```
|
122
127
|
|
123
128
|
Or install it yourself as:
|
124
129
|
|
125
|
-
|
130
|
+
```shell
|
131
|
+
$ gem install deluge-rpc
|
132
|
+
```
|
@@ -67,7 +67,7 @@ module Deluge
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def authenticate(login, password)
|
70
|
-
self.call(DAEMON_LOGIN, login, password)
|
70
|
+
self.call(DAEMON_LOGIN, [login, password, {'client_version' => Deluge::Rpc::VERSION.to_s}])
|
71
71
|
end
|
72
72
|
|
73
73
|
def method_list
|
@@ -93,7 +93,10 @@ module Deluge
|
|
93
93
|
raise "Not connected!" unless @connection
|
94
94
|
|
95
95
|
kwargs = {}
|
96
|
-
|
96
|
+
if args.size == 1 && args[0].last.is_a?(Hash)
|
97
|
+
kwargs = args[0].pop
|
98
|
+
args = args[0]
|
99
|
+
end
|
97
100
|
|
98
101
|
future = Concurrent::IVar.new
|
99
102
|
|
@@ -189,7 +192,10 @@ module Deluge
|
|
189
192
|
|
190
193
|
raise('Received response with unknown protocol_version=' + protocol_version) if protocol_version != PROTOCOL_VERSION
|
191
194
|
|
192
|
-
|
195
|
+
# a big response requires some extra reads because deluged may be
|
196
|
+
# slow to generate and send all the data through the socket
|
197
|
+
raw += socket.readpartial(buffer_size - raw.bytesize) while raw.bytesize < buffer_size
|
198
|
+
|
193
199
|
raw = Zlib::Inflate.inflate(raw)
|
194
200
|
|
195
201
|
parse_packets(raw)
|
data/lib/deluge/rpc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deluge-rpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Yamolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.2.32
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Deluge RPC protocol wrapper
|