|
5 | 5 |
|
6 | 6 | from library import usage |
7 | 7 | from library.createdb.torrents_add import get_tracker |
8 | | -from library.utils import arggroups, argparse_utils, nums, processes |
| 8 | +from library.utils import arggroups, argparse_utils, processes |
9 | 9 | from library.utils.file_utils import trash |
10 | 10 | from library.utils.log_utils import log |
11 | 11 |
|
12 | 12 |
|
13 | 13 | def parse_args(): |
14 | 14 | parser = argparse_utils.ArgumentParser(usage=usage.torrents_start) |
15 | 15 | arggroups.qBittorrent(parser) |
16 | | - parser.add_argument( |
17 | | - "--dl-limit", |
18 | | - "--download-limit", |
19 | | - type=nums.human_to_bytes, |
20 | | - help="Download limit. If set then a few additional global preferences will also be changed", |
21 | | - ) |
22 | | - parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=nums.human_to_bytes, help="Upload limit") |
23 | 16 |
|
24 | 17 | arggroups.capability_delete(parser) |
25 | 18 | arggroups.debug(parser) |
@@ -104,27 +97,6 @@ def torrents_start(): |
104 | 97 |
|
105 | 98 | qbt_client = start_qBittorrent(args) |
106 | 99 |
|
107 | | - if args.dl_limit: # type: ignore |
108 | | - current_count = qbt_client.torrents_count() |
109 | | - max_active_uploads = current_count + 5000 |
110 | | - |
111 | | - qbt_client.app_set_preferences( |
112 | | - { |
113 | | - "preallocate_all": True, |
114 | | - "add_stopped_enabled": False, |
115 | | - "dl_limit": args.dl_limit, |
116 | | - "up_limit": args.up_limit, |
117 | | - "max_active_downloads": 1, |
118 | | - "max_active_uploads": max_active_uploads, |
119 | | - "max_active_torrents": max_active_uploads + 1, |
120 | | - "max_active_checking_torrents": 3, |
121 | | - "slow_torrent_inactive_timer": 80, |
122 | | - # divide by 10 but also some bps -> kbps BS |
123 | | - "slow_torrent_dl_rate_threshold": (args.dl_limit) // 10_000, # type: ignore |
124 | | - "slow_torrent_ul_rate_threshold": (args.up_limit or args.dl_limit) // 10_000, # type: ignore |
125 | | - } |
126 | | - ) |
127 | | - |
128 | 100 | if args.temp_drive and Path(args.temp_drive).is_absolute(): |
129 | 101 | temp_prefix = Path(args.temp_drive) |
130 | 102 | else: |
|
0 commit comments