transmission-rss 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +119 -91
- data/lib/transmission-rss.rb +1 -0
- data/lib/transmission-rss/aggregator.rb +21 -9
- data/lib/transmission-rss/client.rb +1 -1
- data/lib/transmission-rss/core_ext/URI.rb +9 -0
- data/lib/transmission-rss/feed.rb +1 -1
- data/lib/transmission-rss/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f26bb03512a57f35a06bfccceb95883c33b7338af3d00420a017d4b64f80a5d
|
4
|
+
data.tar.gz: 6ab7a09ef74a105b0621325fc2d07562c3f9f6d960ac6ddddb1bd08b0e82c07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96941ea4244382e2410e90b087262894441bfaa8c8f6236807c03396d2218ea692446b85c96db52607ce196757e5a230e8730ce366f97d5c39c78632648f16b9
|
7
|
+
data.tar.gz: c7fa37fb891daf7d9afd40f178ec0cf2aba1e7db3d067fa5ca3ffd657577653356ca9f5423a7351e137529416b967f97ded8b63a5b84d8b82b5b2e40b1b2163a
|
data/README.md
CHANGED
@@ -23,26 +23,36 @@ code to the single most delightful human being: Ann.
|
|
23
23
|
The minimum supported Ruby version is 2.1. (You will need `rbenv` if your
|
24
24
|
os does not support Ruby >= 2.1, e.g. on Debian wheezy.)
|
25
25
|
|
26
|
+
**Note, that this README is for the current development branch!** You can find
|
27
|
+
a link to a suitable README for your version
|
28
|
+
[on the releases page](https://github.com/nning/transmission-rss/releases).
|
29
|
+
|
26
30
|
Installation
|
27
31
|
------------
|
28
32
|
|
29
33
|
### Latest stable version from rubygems.org
|
30
34
|
|
31
|
-
|
35
|
+
```sh
|
36
|
+
gem install transmission-rss
|
37
|
+
```
|
32
38
|
|
33
39
|
### From source
|
34
40
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
41
|
+
```sh
|
42
|
+
git clone https://github.com/nning/transmission-rss
|
43
|
+
cd transmission-rss
|
44
|
+
bundle
|
45
|
+
gem build transmission-rss.gemspec
|
46
|
+
gem install transmission-rss-*.gem
|
47
|
+
```
|
40
48
|
|
41
49
|
### Via Docker
|
42
50
|
|
43
|
-
|
44
|
-
|
45
|
-
|
51
|
+
```sh
|
52
|
+
docker run -t \
|
53
|
+
-v $(pwd)/transmission-rss.conf:/etc/transmission-rss.conf \
|
54
|
+
nning2/transmission-rss:v1.0.0
|
55
|
+
```
|
46
56
|
|
47
57
|
Configuration
|
48
58
|
-------------
|
@@ -60,36 +70,49 @@ have to explicitly specify the others like `log.level`. (True for categories
|
|
60
70
|
|
61
71
|
It should at least contain a list of feeds:
|
62
72
|
|
63
|
-
|
64
|
-
|
65
|
-
|
73
|
+
```yaml
|
74
|
+
feeds:
|
75
|
+
- url: http://example.com/feed1
|
76
|
+
- url: http://example.com/feed2
|
77
|
+
```
|
66
78
|
|
67
79
|
Feed item titles can be filtered by a regular expression:
|
68
80
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
81
|
+
```yaml
|
82
|
+
feeds:
|
83
|
+
- url: http://example.com/feed1
|
84
|
+
regexp: foo
|
85
|
+
- url: http://example.com/feed2
|
86
|
+
regexp: (foo|bar)
|
87
|
+
```
|
74
88
|
|
75
89
|
Feeds can also be configured to download files to specific directory:
|
76
90
|
|
77
|
-
|
78
|
-
|
79
|
-
|
91
|
+
|
92
|
+
```yaml
|
93
|
+
feeds:
|
94
|
+
- url: http://example.com/feed1
|
95
|
+
download_path: /home/user/Downloads
|
96
|
+
```
|
80
97
|
|
81
98
|
Setting the seed ratio limit is supported per feed:
|
82
99
|
|
83
|
-
|
84
|
-
|
85
|
-
|
100
|
+
|
101
|
+
```yaml
|
102
|
+
feeds:
|
103
|
+
- url: http://example.com/feed1
|
104
|
+
seed_ratio_limit: 0
|
105
|
+
```
|
86
106
|
|
87
107
|
Configurable certificate validation, good for self-signed certificates. Default
|
88
108
|
is true:
|
89
109
|
|
90
|
-
|
91
|
-
|
92
|
-
|
110
|
+
|
111
|
+
```yaml
|
112
|
+
feeds:
|
113
|
+
- url: http://example.com/feed1
|
114
|
+
validate_cert: false
|
115
|
+
```
|
93
116
|
|
94
117
|
### All available options
|
95
118
|
|
@@ -102,62 +125,65 @@ transmission is configured for HTTP basic authentication.
|
|
102
125
|
|
103
126
|
See `./transmission-rss.conf.example` for more documentation.
|
104
127
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
128
|
+
|
129
|
+
```yaml
|
130
|
+
feeds:
|
131
|
+
- url: http://example.com/feed1
|
132
|
+
- url: http://example.com/feed2
|
133
|
+
- url: http://example.com/feed3
|
134
|
+
regexp: match1
|
135
|
+
- url: http://example.com/feed4
|
136
|
+
regexp: (match1|match2)
|
137
|
+
- url: http://example.com/feed5
|
138
|
+
download_path: /home/user/Downloads
|
139
|
+
- url: http://example.com/feed6
|
140
|
+
seed_ratio_limit: 1
|
141
|
+
- url: http://example.com/feed7
|
142
|
+
regexp:
|
143
|
+
- match1
|
144
|
+
- match2
|
145
|
+
- url: http://example.com/feed8
|
146
|
+
regexp:
|
147
|
+
- matcher: match1
|
148
|
+
download_path: /home/user/match1
|
149
|
+
- matcher: match2
|
150
|
+
download_path: /home/user/match2
|
151
|
+
- url: http://example.com/feed9
|
152
|
+
validate_cert: false
|
153
|
+
|
154
|
+
update_interval: 600
|
155
|
+
|
156
|
+
add_paused: false
|
157
|
+
|
158
|
+
server:
|
159
|
+
host: localhost
|
160
|
+
port: 9091
|
161
|
+
tls: false
|
162
|
+
rpc_path: /transmission/rpc
|
163
|
+
|
164
|
+
login:
|
165
|
+
username: transmission
|
166
|
+
password: transmission
|
167
|
+
|
168
|
+
log:
|
169
|
+
target: /var/log/transmissiond-rss.log
|
170
|
+
level: debug
|
171
|
+
|
172
|
+
privileges:
|
173
|
+
user: nobody
|
174
|
+
group: nobody
|
175
|
+
|
176
|
+
client:
|
177
|
+
timeout: 5
|
178
|
+
|
179
|
+
fork: false
|
180
|
+
|
181
|
+
single: false
|
182
|
+
|
183
|
+
pid_file: false
|
184
|
+
|
185
|
+
seen_file: ~/.config/transmission/seen
|
186
|
+
```
|
161
187
|
|
162
188
|
Daemonized Startup
|
163
189
|
------------------
|
@@ -168,17 +194,19 @@ The following content can be saved into
|
|
168
194
|
`/etc/systemd/system/transmission-rss.service` to create a systemd unit.
|
169
195
|
Remember checking the path in `ExecStart`.
|
170
196
|
|
171
|
-
|
172
|
-
|
173
|
-
|
197
|
+
```ini
|
198
|
+
[Unit]
|
199
|
+
Description=Transmission RSS daemon.
|
200
|
+
After=network.target transmission-daemon.service
|
174
201
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
202
|
+
[Service]
|
203
|
+
Type=forking
|
204
|
+
ExecStart=/usr/local/bin/transmission-rss -f
|
205
|
+
ExecReload=/bin/kill -s HUP $MAINPID
|
179
206
|
|
180
|
-
|
181
|
-
|
207
|
+
[Install]
|
208
|
+
WantedBy=multi-user.target
|
209
|
+
```
|
182
210
|
|
183
211
|
The unit files are reloaded by `systemctl daemon-reload`. You can then start
|
184
212
|
transmission-rss by running `systemctl start transmission-rss`. Starting on
|
data/lib/transmission-rss.rb
CHANGED
@@ -44,15 +44,8 @@ module TransmissionRSS
|
|
44
44
|
@feeds.each do |feed|
|
45
45
|
@log.debug('aggregate ' + feed.url)
|
46
46
|
|
47
|
-
options = {allow_redirections: :safe}
|
48
|
-
|
49
|
-
unless feed.validate_cert
|
50
|
-
@log.debug('aggregate certificate validation: false')
|
51
|
-
options[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE
|
52
|
-
end
|
53
|
-
|
54
47
|
begin
|
55
|
-
content =
|
48
|
+
content = fetch(feed)
|
56
49
|
rescue StandardError => e
|
57
50
|
@log.debug("retrieval error (#{e.class}: #{e.message})")
|
58
51
|
next
|
@@ -62,7 +55,7 @@ module TransmissionRSS
|
|
62
55
|
# Ruby 1.9.3.
|
63
56
|
content = decompress(content) if RUBY_VERSION == '1.9.3'
|
64
57
|
begin
|
65
|
-
items =
|
58
|
+
items = parse(content)
|
66
59
|
rescue StandardError => e
|
67
60
|
@log.debug("parse error (#{e.class}: #{e.message})")
|
68
61
|
next
|
@@ -85,6 +78,25 @@ module TransmissionRSS
|
|
85
78
|
|
86
79
|
private
|
87
80
|
|
81
|
+
def fetch(feed)
|
82
|
+
options = {
|
83
|
+
allow_redirections: :safe,
|
84
|
+
'User-Agent' => 'transmission-rss'
|
85
|
+
}
|
86
|
+
|
87
|
+
unless feed.validate_cert
|
88
|
+
@log.debug('aggregate certificate validation: false')
|
89
|
+
options[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE
|
90
|
+
end
|
91
|
+
|
92
|
+
# open for URIs is obsolete, URI.open does not work in 2.4
|
93
|
+
URI.send(:open, feed.url, options).read
|
94
|
+
end
|
95
|
+
|
96
|
+
def parse(content)
|
97
|
+
RSS::Parser.parse(content, false).items
|
98
|
+
end
|
99
|
+
|
88
100
|
def decompress(string)
|
89
101
|
Zlib::GzipReader.new(StringIO.new(string)).read
|
90
102
|
rescue Zlib::GzipFile::Error, Zlib::Error
|
@@ -48,7 +48,7 @@ module TransmissionRSS
|
|
48
48
|
|
49
49
|
case type
|
50
50
|
when :url
|
51
|
-
file = URI.
|
51
|
+
file = URI.escape(file) if URI.unescape(file) == file
|
52
52
|
arguments.filename = file
|
53
53
|
when :file
|
54
54
|
arguments.metainfo = Base64.encode64(File.read(file))
|
@@ -9,7 +9,7 @@ module TransmissionRSS
|
|
9
9
|
when Hash
|
10
10
|
@config = config
|
11
11
|
|
12
|
-
@url = URI.
|
12
|
+
@url = URI.escape(config['url'] || config.keys.first)
|
13
13
|
|
14
14
|
@download_path = config['download_path']
|
15
15
|
@validate_cert = config['validate_cert'].nil? || config['validate_cert']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transmission-rss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- henning mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: open_uri_redirections
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/transmission-rss/core_ext/Array.rb
|
73
73
|
- lib/transmission-rss/core_ext/Hash.rb
|
74
74
|
- lib/transmission-rss/core_ext/Object.rb
|
75
|
+
- lib/transmission-rss/core_ext/URI.rb
|
75
76
|
- lib/transmission-rss/feed.rb
|
76
77
|
- lib/transmission-rss/log.rb
|
77
78
|
- lib/transmission-rss/seen_file.rb
|
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
97
|
- !ruby/object:Gem::Version
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
100
|
+
rubygems_version: 3.1.2
|
100
101
|
signing_key:
|
101
102
|
specification_version: 4
|
102
103
|
summary: Adds torrents from rss feeds to transmission web frontend.
|