From 46bcd2cbaf31407425efb2927720d329a8e95a49 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Thu, 29 Feb 2024 16:06:44 -0500 Subject: [PATCH] Revert "feat: startswith to contains for tracker messages" (#45) * Revert "feat: startswith to contains for tracker messages (#43)" This reverts commit e4a5143b11979a1da9daea5ffe15e2f8b5ba8423. * Update tagging.py --- qbtools/commands/tagging.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qbtools/commands/tagging.py b/qbtools/commands/tagging.py index d3f3f79..2707262 100755 --- a/qbtools/commands/tagging.py +++ b/qbtools/commands/tagging.py @@ -39,7 +39,8 @@ 'trumped', 'torrent existiert nicht', 'other', - 'i\'m sorry dave, i can\'t do that' # weird stuff from racingforme + 'i\'m sorry dave, i can\'t do that', # weird stuff from racingforme + '002: invalid infohash' ] MAINTENANCE_MATCHES = [ @@ -123,8 +124,8 @@ def __init__(args, logger): working = len(list(filter(lambda s: s.status == 2, t.trackers))) > 0 if (args.unregistered or args.tracker_down or args.not_working) and not working: - unregistered_matched = any(x.lower() in z.msg.lower() for x in UNREGISTERED_MATCHES for z in filtered_trackers) - maintenance_matched = any(x.lower() in z.msg.lower() for x in MAINTENANCE_MATCHES for z in filtered_trackers) + unregistered_matched = any(z.msg.lower().startswith(x.lower()) for x in UNREGISTERED_MATCHES for z in filtered_trackers) + maintenance_matched = any(z.msg.lower().startswith(x.lower()) for x in MAINTENANCE_MATCHES for z in filtered_trackers) if args.unregistered and unregistered_matched: tags_to_add.append('unregistered') elif args.tracker_down and maintenance_matched: