Skip to content

Commit fbf9cb5

Browse files
committed
Adds new command share_limits to update share limits based on tags/categories specified per group
(Closes #88, Closes #306, Closes #259, Closes #308, Closes #137)
1 parent fe56320 commit fbf9cb5

10 files changed

+677
-564
lines changed

CHANGELOG

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Requirements Updated
2-
- Updates ruamel.yaml to 0.17.27
2+
- Updates ruamel.yaml to 0.17.30
3+
- Updates qbitorrent-api to 2023.5.48
4+
5+
# New Features
6+
- Adds new command `share_limits`, `--share-limits` , `QBT_SHARE_LIMITS=True` to update share limits based on tags/categories specified per group (Closes #88, Closes #306, Closes #259, Closes #308, Closes #137)
7+
- Adds new command `skip_qb_version_check`, `--skip-qb-version-check`, `QBT_SKIP_QB_VERSION_CHECK` to bypass qbitorrent compatibility check (unsupported - Thanks to @ftc2 #307)
8+
# Breaking Changes
9+
- `tag_nohardlinks` only updates/removes `noHL` tag. It does not modify or cleanup share_limits anymore.
10+
- `tag_update` only adds tracker tags to torrent. It does not modify or cleanup share_limits anymore.
11+
- Please remove any references to share_limits from your configuration in the tracker/nohardlinks section
312

413
# Bug Fixes
514
- Fixes #302
6-
- Adds a way to bypass qbt version check (unsupported - Thanks to @ftc2 #307)
715

8-
**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v3.6.3...v3.6.4
16+
**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v3.6.3...v3.7.0

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.4-develop1
1+
3.6.4-develop2

config/config.yml.sample

+56-50
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ commands:
1414
tag_tracker_error: False
1515
rem_orphaned: False
1616
tag_nohardlinks: False
17+
share_limits: False
18+
skip_qb_version_check: False
1719
skip_cleanup: False
1820

1921
qbt:
@@ -26,6 +28,7 @@ settings:
2628
force_auto_tmm: False # Will force qBittorrent to enable Automatic Torrent Management for each torrent.
2729
tracker_error_tag: issue # Will set the tag of any torrents that do not have a working tracker.
2830
nohardlinks_tag: noHL # Will set the tag of any torrents with no hardlinks.
31+
share_limits_suffix_tag: share_limit # Will add this suffix to the grouping separated by '.' to the tag of any torrents with share limits.
2932
ignoreTags_OnUpdate: # When running tag-update function, it will update torrent tags for a given torrent even if the torrent has at least one or more of the tags defined here. Otherwise torrents will not be tagged if tags exist.
3033
- noHL
3134
- issue
@@ -68,14 +71,6 @@ tracker:
6871
# <Tracker URL Keyword>: # <MANDATORY> This is the keyword in the tracker url
6972
# <MANDATORY> Set tag name. Can be a list of tags or a single tag
7073
# tag: <Tag Name>
71-
# <OPTIONAL> Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading. -2 means the global limit should be used, -1 means no limit.
72-
# max_ratio: 5.0
73-
# <OPTIONAL> Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding. -2 means the global limit should be used, -1 means no limit.
74-
# max_seeding_time: 129600
75-
# <OPTIONAL> Will ensure that noHL torrents from this tracker are not deleted by cleanup variable if torrent has not yet met the minimum seeding time (min).
76-
# min_seeding_time: 2000
77-
# <OPTIONAL> Will limit the upload speed KiB/s (KiloBytes/second) (-1 means no limit)
78-
# limit_upload_speed: 150
7974
# <OPTIONAL> Set this to the notifiarr react name. This is used to add indexer reactions to the notifications sent by Notifiarr
8075
# notifiarr: <notifiarr indexer>
8176
animebytes.tv:
@@ -86,10 +81,6 @@ tracker:
8681
- Avistaz
8782
- tag2
8883
- tag3
89-
max_ratio: 5.0
90-
max_seeding_time: 129600
91-
min_seeding_time: 30400
92-
limit_upload_speed: 150
9384
notifiarr: avistaz
9485
beyond-hd:
9586
tag: [Beyond-HD, tag2, tag3]
@@ -101,14 +92,11 @@ tracker:
10192
tag: CartoonChaos
10293
digitalcore:
10394
tag: DigitalCore
104-
max_ratio: 5.0
10595
notifiarr: digitalcore
10696
gazellegames:
10797
tag: GGn
108-
limit_upload_speed: 150
10998
hdts:
11099
tag: HDTorrents
111-
max_seeding_time: 129600
112100
landof.tv:
113101
tag: BroadcasTheNet
114102
notifiarr: broadcasthenet
@@ -145,48 +133,66 @@ nohardlinks:
145133
- Beyond-HD
146134
- AnimeBytes
147135
- MaM
148-
# <OPTIONAL> cleanup var: WARNING!! Setting this as true Will remove and delete contents of any torrents that have a noHL tag and meets share limits
149-
cleanup: false
150-
# <OPTIONAL> max_ratio var: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading.
151-
# Delete this key from a category's config to use the tracker's configured max_ratio. Will default to -1 if not specified for the category or tracker.
152-
# Uses the larger value of the noHL Category or Tracker specific setting.
153-
max_ratio: 4.0
154-
# <OPTIONAL> max seeding time var: Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding.
155-
# Delete this key from a category's config to use the tracker's configured max_seeding_time. Will default to -1 if not specified for the category or tracker.
156-
# Uses the larger value of the noHL Category or Tracker specific setting.
157-
max_seeding_time: 86400
158-
# <OPTIONAL> Limit Upload Speed var: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
159-
limit_upload_speed:
160-
# <OPTIONAL> min seeding time var: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (min).
161-
# Delete this key from a category's config to use the tracker's configured min_seeding_time. Will default to 0 if not specified for the category or tracker.
162-
# Uses the larger value of the noHL Category or Tracker specific setting.
163-
min_seeding_time: 43200
164-
# <OPTIONAL> resume_torrent_after_untagging_noHL var: If a torrent was previously tagged as NoHL and now has hardlinks, this variable will resume your torrent after changing share limits
165-
resume_torrent_after_untagging_noHL: false
166136
# Can have additional categories set with separate ratio/seeding times defined.
167137
series-completed:
168138
# <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category.
169139
exclude_tags:
170140
- Beyond-HD
171141
- BroadcasTheNet
172-
# <OPTIONAL> cleanup var: WARNING!! Setting this as true Will remove and delete contents of any torrents that have a noHL tag and meets share limits
173-
cleanup: false
174-
# <OPTIONAL> max_ratio var: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading.
175-
# Delete this key from a category's config to use the tracker's configured max_ratio. Will default to -1 if not specified for the category or tracker.
176-
# Uses the larger value of the noHL Category or Tracker specific setting.
177-
max_ratio: 4.0
178-
# <OPTIONAL> max seeding time var: Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding.
179-
# Delete this key from a category's config to use the tracker's configured max_seeding_time. Will default to -1 if not specified for the category or tracker.
180-
# Uses the larger value of the noHL Category or Tracker specific setting.
181-
max_seeding_time: 86400
182-
# <OPTIONAL> Limit Upload Speed var: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
183-
limit_upload_speed:
184-
# <OPTIONAL> min seeding time var: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (min).
185-
# Delete this key from a category's config to use the tracker's configured min_seeding_time. Will default to 0 if not specified for the category or tracker.
186-
# Uses the larger value of the noHL Category or Tracker specific setting.
142+
143+
share_limits:
144+
# Control how torrent share limits are set depending on the priority of your grouping
145+
# This variable is mandatory and is a text defining the name of your grouping. This can be any string you want
146+
noHL:
147+
# <MANDATORY> priority: <int/float> # This is the priority of your grouping. The lower the number the higher the priority
148+
priority: 1
149+
# <OPTIONAL> tags: <list> # Filter the group based on one or more tags. Multiple tags are checked with an AND condition
150+
tags:
151+
- noHL
152+
# <OPTIONAL> exclude_tags: <list> # Filter by excluding one or more tags. Multiple exclude_tags are checked with an AND condition
153+
# This is useful to combine with the category filter to exclude one or more tags from an entire category
154+
exclude_tags:
155+
- Beyond-HD
156+
# <OPTIONAL> categories: <list> # Filter by excluding one or more categories. Multiple exclude_tags are checked with an OR condition
157+
# Since one torrent can only be associated with a single category, multiple categories are checked with an OR condition
158+
categories:
159+
- RadarrComplete
160+
- SonarrComplete
161+
# <OPTIONAL> max_ratio <float>: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading.
162+
# Delete this key from a category's config to use the tracker's configured max_ratio. Will default to -1 if not specified for the group.
163+
max_ratio: 5.0
164+
# <OPTIONAL> max_seeding_time <int>: Will set the torrent Maximum seeding time (minutes) until torrent is stopped from seeding.
165+
# Delete this key from a category's config to use the tracker's configured max_seeding_time. Will default to -1 if not specified for the group.
166+
max_seeding_time: 129600
167+
# <OPTIONAL> min_seeding_time <int>: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (minutes).
168+
# Delete this key from a category's config to use the tracker's configured min_seeding_time. Will default to 0 if not specified for the group.
187169
min_seeding_time: 43200
188-
# <OPTIONAL> resume_torrent_after_untagging_noHL var: If a torrent was previously tagged as NoHL and now has hardlinks, this variable will resume your torrent after changing share limits
189-
resume_torrent_after_untagging_noHL: false
170+
# <OPTIONAL> Limit Upload Speed <int>: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
171+
limit_upload_speed: 0
172+
# <OPTIONAL> cleanup <bool>: WARNING!! Setting this as true Will remove and delete contents of any torrents that satisfies the share limits
173+
cleanup: false
174+
# <OPTIONAL> resume_torrent_after_change <bool>: This variable will resume your torrent after changing share limits. Default is true
175+
resume_torrent_after_change: true
176+
# <OPTIONAL> add_group_to_tag <bool>: This adds your grouping as a tag with a suffix defined in settings . Default is true
177+
# Example: A grouping defined as noHL will have a tag set to noHL.share_limit (if using the default suffix)
178+
add_group_to_tag: true
179+
cross-seed:
180+
priority: 2
181+
tags: cross-seed
182+
max_seeding_time: 10200
183+
cleanup: false
184+
PTP:
185+
priority: 3
186+
tags:
187+
- PassThePopcorn
188+
max_ratio: 2.0
189+
max_seeding_time: 130000
190+
cleanup: false
191+
default:
192+
priority: 999
193+
max_ratio: -1
194+
max_seeding_time: -1
195+
cleanup: false
190196

191197
recyclebin:
192198
# Recycle Bin method of deletion will move files into the recycle bin (Located in /root_dir/.RecycleBin) instead of directly deleting them in qbit

modules/apprise.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""Apprise notification class"""
2+
import time
3+
24
from modules import util
35
from modules.util import Failed
46

@@ -14,5 +16,6 @@ def __init__(self, config, params):
1416
logger.secret(self.api_url)
1517
self.notify_url = ",".join(params["notify_url"])
1618
response = self.config.get(self.api_url)
19+
time.sleep(1) # Pause for 1 second before sending the next request
1720
if response.status_code != 200:
1821
raise Failed(f"Apprise Error: Unable to connect to Apprise using {self.api_url}")

0 commit comments

Comments
 (0)