Skip to content

Commit 674e71f

Browse files
release: version 1.5.4
Merge pull request #138 from jerrymakesjelly/dev
2 parents 2d39a63 + acc1982 commit 674e71f

67 files changed

Lines changed: 1929 additions & 765 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README-cn.rst

Lines changed: 23 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -107,146 +107,41 @@
107107
-----------
108108
|Screenshot|
109109

110-
.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/40576720-a78097fe-612d-11e8-9dda-8aac0c5011a2.png
110+
.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/174464634-15743d59-f1dc-41c9-bff6-6d90becaeb67.gif
111111

112112
更新日志
113113
----------
114-
**2020-08-27 周四**:1.5.3 版本
114+
**2022-06-19 星期日**:版本 1.5.4
115115

116-
* 修复 psutil 在群晖的兼容问题(用于检查磁盘剩余空间)。(#61)
117-
* 可以通过 ``--debug`` 或 ``-d`` 命令行启用调试模式。(#76)
118-
* 修复由主机 URL 末尾的 ``/`` 导致的 API 不兼容的问题。(#81)
119-
* 添加上传量与下载量两个条件。(#79)
116+
变动
117+
+++++
120118

121-
**2020-03-27 周五**:1.5.2 版本。
119+
* 移除端口开放状态(Outgoing Port Status)的信息。(#101) (#135)
120+
- 我们确认了一个 bug,即,当我们使用 Transmission 并在 IPv6 网络下检查端口开放状态时,Transmission 的端口检查器会报错并提示“portTested: http error 400: Bad Request”。
121+
- 由于没有删种条件需要依赖这个端口开放状态,所以我们删了它。
122122

123-
* 支持 Deluge (#8);
124-
* 使用批量删除提升删除效率;
125-
* 修复配置文件中的多语言支持问题(#69);
126-
* 客户端名称不再对大小写敏感。
123+
* 修改了 ``last_activity`` 的行为。(#93) (#98) (#109)
124+
- 默认情况下,``last_activity`` 不再删除那些从未活跃过的种子。
125+
- 在需要的情况下,这些从未活跃过的种子可以用以下的方式去删除:
126+
+ 对于 ``last_activity`` 条件,使用 ``last_activity: never`` 或者 ``last_activity: none``。
127+
+ 对于 ``remove`` 表达式,使用 ``last_activity = never`` 或者 ``last_activity = none``。
127128

128-
**2020-02-29 周六**:1.5.1 版本。
129+
新功能
130+
++++++
129131

130-
* 修复了 1.5.0 版本中丢失的状态 ``StalledUpload`` 和 ``StalledDownload``。(#66)
132+
* 在 ``action`` 关键字中添加了 ``remove-slow-upload-seeds`` 和 ``remove-fast-upload-seeds`` 两个动作。 (#127) 感谢 @vincent906!
133+
* remove 表达式中支持等号(``=``)。
134+
* 添加 ``downloading_time`` 条件。 (#88) 感谢 @dantebarba!
131135

132-
**2020-02-28 周五**:1.5.0 版本。
136+
修复
137+
+++++
133138

134-
* 修复了无法登录使用纯数字用户名或密码的客户端的问题(#64);
135-
* 修复了在没有标签属性的 Transmission 中任务无法执行的问题;
136-
* 修复了删种条件可能对未打标签以及没有Tracker的种子无效的问题;
137-
* 修复了 status 中遗漏的 μTorrent 状态“排队中”(``Queued``);
138-
* ``status`` 中添加 ``Error`` 状态;
139-
* 添加对 Transmission 标签的支持(#24);
140-
* 添加删除条件“最大下载速度” ``max_downloadspeed``、“最小上传速度” ``min_uploadspeed``;
141-
* 添加删除条件“最小平均上传速度” ``min_average_uploadspeed``、“最大平均下载速度” ``max_average_downloadspeed`` (#49);
142-
* 添加删除条件“最大种子大小” ``max_size`` (#21);
143-
* 添加删除条件“最大做种数” ``max_seeder``、“最小下载数” ``min_leecher`` (#62);
144-
* 添加删除条件“最大已连接做种者” ``max_connected_seeder``、“最小已连接下载者” ``min_connected_leecher``;
145-
* 添加删除条件“最后活动时间” ``last_activity``,以删除一段时间内没有上传或下载速度的种子(#1)(#9);
146-
* 添加删除条件“最大下载百分比” ``max_progress``;
147-
* ``free_space``、``maximum_number``、``seed_size`` 的 ``action`` 中添加 ``remove-active-seeds``、``remove-inactive-seeds`` 动作,用于根据最后活动时间去尽量删除活跃的种子或者不活跃的种子(#9);
148-
* 添加了新的删除条件“上传比率” ``upload_ratio``,可以根据上传量占种子大小的比例删种(#55);
139+
* 修复了上传/下载量以及 ``free_space``、``remote_free_space`` 不能正确处理小数的问题。 (#133) 感谢 @sfwn!
140+
* 修复了 ``last_activity`` 条件在 Deluge 2.0.3 及以上版本无效的问题。(#119)
149141

150-
**2020-02-03 周一**:迁移文档到 Read the Docs。
142+
`更多更新日志`_
151143

152-
**2020-01-26 周日**: 1.4.9 版本。
153-
154-
* 添加了 `free_space` 条件(最小剩余空间)。
155-
156-
**2020-01-07 周二**: 1.4.8 版本。
157-
158-
* 修复了在 qBittorrent v4.2.1 中不能删除种子的问题。对造成的不便深感抱歉。 (#53)
159-
160-
**2020-01-06 周一**: 1.4.7 版本。
161-
162-
* 添加了 qBittorrent v4.2.1 中新 API 的支持。 (#46) **注意:这个版本有bug,请升级到1.4.8或者更高的版本。**
163-
164-
**2019-09-17 周二**: 1.4.6 版本。
165-
166-
* 修复了当 Tracker 的 URL 包含端口时,`tracker` 过滤器需要指定端口的问题。
167-
168-
**2019-06-06 周四**: 1.4.5 版本。
169-
170-
* 添加了 `StalledUpload` 与 `StalledDownload` 状态。
171-
172-
**2019-05-22 周三**: 1.4.4 版本。
173-
174-
* 修复了当 `seed_size` / `maximum_number` 条件与 `ratio` / `create_time` / `seeding_time` 条件同时使用时任务会失败的问题。(#33)
175-
* 新特性:如果过滤器的内容只有一行,现在可以直接写出而不需要使用列表。
176-
177-
**2019-05-19 周日**: 1.4.3 版本。
178-
179-
* 添加对 Python 2.7 的支持。(#29)
180-
* 停止支持 Python 3.4。(kennethreitz/requests#5092)
181-
182-
**2019-05-13 周一**: 1.4.2 版本。
183-
184-
* 修复了丢失的语法分析器文件。(#32)
185-
* 修复了运算符的结合性。现在,运算符 `and` 和 `or` 保证是左结合的。(#32)
186-
187-
**2019-05-06 周一**: 1.4.1 版本。
188-
189-
* 修复了丢失的依赖项 `ply`。
190-
* 修复了在`remove`条件中重复定义的警告。
191-
192-
**2019-05-06 周一**: 更新了文档。
193-
194-
* 增加了关于`remove`条件的描述。
195-
196-
**2019-05-01 周三**: 1.4.0 版本。
197-
198-
* 删除了 ``seeding_time`` 和 ``ratio`` 条件中的限制 (#19)。
199-
- 在之前的版本,``seeding_time`` 和 ``ratio`` 条件只会删除那些正在做种的种子。设置这个限制是为了给用户提供一个通过修改种子的状态(例如暂停做种)来避免种子被删除的方法。
200-
- 不过现在我们有状态过滤器(``status``),所以这个限制就显得多余了,而且可能会使它的行为跟用户预想的不一样。
201-
* 支持自定义删除表达式 (#15)。
202-
- 现在我们可以直接而明确地写出我们想要的表达式了,例如 ``remove: ratio > 1``。
203-
- 复合的条件表达式也支持,例如 ``remove: (seeding_time < 86400 and ratio > 1) or (seeding_time > 86400 and ratio > 3)``。
204-
- 旧的写法仍然可用。
205-
206-
**2019-04-17 周三**: 1.3.0 版本。
207-
208-
* 修复了在 qBittorrent 拥有大量的种子时程序会卡住的问题 (`Issue #22 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/22>`_)。
209-
* 修复了状态过滤器在工作时会写入重复的日志的问题。
210-
* 日志系统已更新:
211-
- 日志路径可以被指定(使用 ``--log`` 参数,例如 ``--log=/home/jerrymakesjelly/logs``) (`Issue #23 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/23>`_)。
212-
- 日志文件将按天存储在不同的文件中(格式:``autoremove.%Y-%m-%d.log``)。
213-
* 全部单词 ``seed`` 修改为 ``torrent`` (`Issue #25 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/25>`_)。
214-
* 删去了所有不必要的调试日志。
215-
216-
**2019-01-10 周一**: 1.2.5 版本。
217-
218-
* 修复了在设置多个策略时种子数量不正确的问题 (`Issue #10 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/10>`_, 感谢 @momokoo 报告此问题并提出 PR).
219-
* 修复了在 qBittorrent 中种子数不正确的问题 (`Issue #13 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/13>`_)。
220-
221-
**2018-05-31 周四**: 1.2.4 版本。
222-
223-
* 修复了启动失败的问题。
224-
225-
**2018-05-30 周三**: 1.2.3 版本。增加了一些功能。
226-
227-
* 允许使用环境变量去指定 ``host``、``username`` 和 ``password``。
228-
* 允许 ``username`` 和 ``password`` 留空(或者其中之一留空),使得不用用户名或密码也可以登录 WebUI。
229-
* 现在程序在一个任务失败时不会直接退出。
230-
231-
**2018-05-27 周日**: 1.2.2 版本。 增加了一些功能 :smile:
232-
233-
* 增加了新过滤器:种子状态。
234-
* 增加了新条件:最大种子数量。
235-
236-
**2018-05-26 周六**: 1.2.1 版本。 修复了 ``setup.py`` 的问题。
237-
238-
**2018-05-26 周六**: 1.2.0 版本. 重构已完成,程序已发布至 PyPI。
239-
240-
* 新特性很快会被加入。
241-
* 现在你可以通过 ``pip`` 安装程序。
242-
243-
**2018-05-14 周一**: 1.1.0 版本。 创建了 ``setup.py``。
244-
245-
现在你可以直接使用 ``autoremove-torrents`` 命令而不是 ``python3 main.py``。
246-
247-
**2018-03-28 周三**: (更正文档) ``delete_data`` 字段不应该被缩进。
248-
249-
**2018-03-22 周四**: 第一个版本 :bowtie:
144+
.. _更多更新日志: https://autoremove-torrents.readthedocs.io/zh_CN/latest/changelog.html
250145

251146
计划列表
252147
-----------

README.rst

Lines changed: 23 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -109,146 +109,41 @@ Screenshot
109109
-----------
110110
|Screenshot|
111111

112-
.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/40576720-a78097fe-612d-11e8-9dda-8aac0c5011a2.png
112+
.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/174464634-15743d59-f1dc-41c9-bff6-6d90becaeb67.gif
113113

114114
Changelog
115115
----------
116-
**Thu, 27 Aug 2020**: Version 1.5.3.
116+
**Sun, 19 June 2022**: Version 1.5.4.
117117

118-
* Fix psutil's compatibility in Synology (use to check the free spaces). (#61)
119-
* Enable to output debug logs by specifying ``--debug`` or ``-d`` argument. (#76)
120-
* Fix API imcompatibility issue caused by the trailing ``/`` in host URL. (#81)
121-
* Add uploaded size and downloaded size conditions. (#79)
118+
Changes
119+
++++++++
122120

123-
**Fri, 27 Mar 2020**: Version 1.5.2.
121+
* Remove outgoing port status info. (#101) (#135)
122+
- We have confirmed a bug, which is, the outgoing port status checker will fail and report 'portTested: http error 400: Bad Request' when we are using Transmission and check the outgoing port status in IPv6 network.
123+
- Since there are no configurations relying on this status, we remove it.
124124

125-
* Support Deluge. (#8)
126-
* Use batch delete to improve efficiency.
127-
* Fix multi-language support in config file. (#69)
128-
* Set the client names to be case-insensitive.
125+
* Change ``last_activity``'s behaviour. (#93) (#98) (#109)
126+
- It won't remove those torrents that have never been active anymore.
127+
- These torrents that have never been active can be removed by the following configuration:
128+
+ ``last_activity: never`` or ``last_activity: none`` for ``last_activity`` condition.
129+
+ ``last_activity = never`` or ``last_activity = none`` for ``remove`` expression.
129130

130-
**Sat, 29 Feb 2020**: Version 1.5.1.
131+
Features
132+
+++++++++
131133

132-
* Fix missing status ``StalledUpload`` and ``StalledDownload`` in version 1.5.0. (#66)
134+
* Add ``remove-slow-upload-seeds`` and ``remove-fast-upload-seeds`` in actions. (#127) Thanks to @vincent906!
135+
* Support equality (``=``) comparison in remove expression.
136+
* Add downloading time condition. (#88) Thanks to @dantebarba!
133137

134-
**Fri, 28 Feb 2020**: Version 1.5.0.
135-
136-
* Fix a problem: cannot login to client with numeric username or password. (#64)
137-
* Fix a problem: tasks could not be executed in a Transmission without label properties.
138-
* Fix a problem: removing conditions may not work for unlabeled and trackerless torrents.
139-
* Fix a problem: missing status ``Queued`` in μTorrent.
140-
* Add new status ``Error`` to filter ``status``.
141-
* Add support for Transmission labels. (#24)
142-
* Add removing conditions: Maximum Download Speed ``max_downloadspeed`` and Minimum Upload Speed ``min_uploadspeed``.
143-
* Add removing conditions: Maximum Average Download Speed ``max_average_downloadspeed`` and Minimum Average Upload Speed ``min_average_uploadspeed``. (#49)
144-
* Add removing conditions: Maximum Torrent Size ``max_size``. (#21)
145-
* Add removing conditions: Maximum Number of Seeders ``max_seeder`` and Minimum Number of Leechers ``min_leecher``. (#62)
146-
* Add removing conditions: Maximum Number of Connected Seeders ``max_connected_seeder`` and Minimum Number of Connected Leechers ``min_connected_leecher``.
147-
* Add a removing condition: Last Activity ``last_activity``, which removes torrents without upload or download speed for a period of time. (#1) (#9)
148-
* Add a removing condition: Maximum Download Progress ``max_progress``.
149-
* Add actions: add ``remove-active-seeds`` and ``remove-inactive-seeds`` to ``free_space``, ``maximum_number`` and ``seed_size`` in order to try to remove active or inactive torrents based on the last active time. (#9)
150-
* Add a removing condition: Upload Ratio ``upload_ratio``, which can remove torrents based on the ratio of uploaded size to torrent size. (#55)
151-
152-
**Mon, 3 Feb 2020**: Migrate documents to Read the Docs.
153-
154-
**Sun, 26 Jan 2020**: Version 1.4.9.
155-
156-
* Add `free_space` condition.
157-
158-
**Tue, 7 Jan 2020**: Version 1.4.8.
159-
160-
* Fix bug that cannot delete torrents in qBittorrent v4.2.1+. Sorry for any inconvenience. (#53)
161-
162-
**Mon, 6 Jan 2020**: Version 1.4.7.
163-
164-
* Add support for new API in qBittorrent 4.2.1. (#46) **Note: This version has a bug. Please upgrade to v1.4.8 or higher.**
165-
166-
**Tue, 17 Sep 2019**: Version 1.4.6.
167-
168-
* Fix problem that the tracker filter needs to specific ports when the tracker URL includes port number. (#38)
169-
170-
**Thu, 6 Jun 2019**: Version 1.4.5.
171-
172-
* Added status `StalledUpload` and `StalledDownload`. (#34)
173-
174-
**Wed, 22 May 2019**: Version 1.4.4.
175-
176-
* Fixed a bug that when condition `seed_size` / `maximum_number` is used together with condtion `ratio` / `create_time` / `seeding_time`, the task will fail. (#33)
177-
* New feature: if the content of `filter` has only one line, now it is allowed to write down directly without using list.
178-
179-
**Sun, 19 May 2019**: Version 1.4.3.
180-
181-
* Supported Python 2.7. (#29)
182-
* Stopped supporting Python 3.4. (kennethreitz/requests#5092)
183-
184-
**Mon, 13 May 2019**: Version 1.4.2.
185-
186-
* Fixed missing parser files. (#32)
187-
* Fixed association of operators. (#32) Now the operator `and` and `or` are guaranteed to be left-associative.
188-
189-
**Mon, 6 May 2019**: Version 1.4.1.
190-
191-
* Fixed missing dependency: `ply`.
192-
* Fixed the warning of duplicate definition in condition `remove`.
193-
194-
**Mon, 6 May 2019**: Updated Wiki.
195-
196-
* Added the description of `remove` condition into Simplified-Chinese Wiki.
197-
198-
**Wed, 1 May 2019**: Version 1.4.0.
199-
200-
* Removed torrent status restriction in ``seeding_time`` and ``ratio`` condition (#19).
201-
- Before this version, ``seeding_time`` and ``ratio`` condition will only remove those torrents whose status are seeding. We set this restriction to provide a method for users to avoid a torrent being removed by changing its status (e.g. pause seeding).
202-
- But now we have a ``status`` filter, this restriction becomes unnecessary, and its behavior may be different from users expectation.
203-
* Supported custom remove expressions (#15).
204-
- Now we can write the condition that we want directly and clearly, e.g. ``remove: ratio > 1``.
205-
- Composite condition expressions are also supported, e.g. ``remove: (seeding_time < 86400 and ratio > 1) or (seeding_time > 86400 and ratio > 3)``. Visit Wiki to learn more.
206-
- The old remove conditions are still available.
207-
208-
**Wed, 17 Apr 2019**: Version 1.3.0.
209-
210-
* Fixed bug: Program gets stuck when there are a lot of torrents in qBittorrent client (`Issue #22 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/22>`_).
211-
* Fixed bug: Duplicated logging in status filter.
212-
* Log system was updated:
213-
- Log path can be specified (Use ``--log`` argument, e.g. ``--log=/home/jerrymakesjelly/logs``) (`Issue #23 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/23>`_).
214-
- Logs are stored in different files by day (Format: ``autoremove.%Y-%m-%d.log``).
215-
* Changed the word ``seed`` to ``torrent`` (`Issue #25 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/25>`_).
216-
* Removed uncessary debug messages.
217-
218-
**Mon, 10 Jan 2019**: Version 1.2.5.
219-
220-
* Fixed bug: Incorrect number of torrents in multiple strategies (`Issue #10 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/10>`_, thanks to @momokoo for the report and PR).
221-
* Fixed bug: Incorrect number of torrents in qBittorrent (`Issue #13 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/13>`_).
222-
223-
**Thu, 31 May 2018**: Version 1.2.4.
224-
225-
* Fixed startup failure.
226-
227-
**Wed, 30 May 2018**: Version 1.2.3. Added new features.
228-
229-
* Allowed to use environment variables to specify *host*, *username* and *password*.
230-
* Allowed *username* and *password* to be empty (or one of them is empty) to log in a WebUI without username and/or password.
231-
* Now the program won't quit directly when a task goes failed.
232-
233-
**Sun, 27 May 2018**: Version 1.2.2. Added new features :smile:
234-
235-
* Added new filter: Torrent Status
236-
* Added new condition: Maximum number of torrents
237-
238-
**Sat, 26 May 2018**: Version 1.2.1. Fixed issue in *setup.py*.
239-
240-
**Sat, 26 May 2018**: Version 1.2.0. Refactoring was completed, and was published to PyPI.
241-
242-
* New features will be added soon.
243-
* Now we can install it via *pip*.
244-
245-
**Mon, 14 May 2018**: Version 1.1.0. Created *setup.py*.
138+
Fix
139+
++++
246140

247-
You can now use the *autoremove-torrents* command directly instead of *python3 main.py*.
141+
* Fix a bug that Downloaded/Uploaded Size conditions and ``free_space``/``remote_free_space`` cannot handle decimals correctly. (#133) Thanks to @sfwn!
142+
* Fix a bug that ``last_activity`` condition doesn't work in Deluge 2.0.3 and above. (#119)
248143

249-
**Wed, 28 Mar 2018**: (Correct document) The *delete_data* field shouldn't be indented.
144+
`More changelogs`_
250145

251-
**Thu, 22 Mar 2018**: First version :bowtie:
146+
.. _More changelogs: https://autoremove-torrents.readthedocs.io/en/latest/changelog.html
252147

253148
TODO List
254149
-----------

autoremovetorrents/client/deluge.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from deluge_client.client import DelugeClientException
44
from ..torrent import Torrent
55
from ..clientstatus import ClientStatus
6-
from ..portstatus import PortStatus
76
from ..torrentstatus import TorrentStatus
87
from ..exception.loginfailure import LoginFailure
98
from ..exception.remotefailure import RemoteFailure
@@ -66,10 +65,6 @@ def client_status(self):
6665
cs.upload_speed = session_stats['payload_upload_rate']
6766
cs.total_uploaded = session_stats['total_upload']
6867

69-
# Get port status
70-
port_is_open = self._call('core.test_listen_port')
71-
cs.port_status = PortStatus.Open if port_is_open else PortStatus.Closed
72-
7368
return cs
7469

7570
# Get Deluge version
@@ -154,8 +149,8 @@ def torrent_properties(self, torrent_hash):
154149
download_time = torrent['active_time'] - torrent['finished_time']
155150
torrent_obj.average_download_speed = torrent['all_time_download'] / download_time if download_time > 0 else 0
156151
if 'time_since_transfer' in torrent:
157-
# Set the last active time of those never active torrents to timestamp 0
158-
torrent_obj.last_activity = torrent['time_since_transfer'] if torrent['time_since_transfer'] > 0 else 0
152+
torrent_obj.last_activity = torrent['time_since_transfer'] \
153+
if torrent['time_since_transfer'] > 0 else None
159154
torrent_obj.progress = torrent['progress'] / 100 # Accept Range: 0-1
160155

161156
return torrent_obj

0 commit comments

Comments
 (0)