From 837d652c68ab50bbc38a77bd00c7254192be3d25 Mon Sep 17 00:00:00 2001 From: VP-EN <67713433+VP-EN@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:46:58 +0200 Subject: [PATCH 1/2] NinjaCentral fix (NZBGet) This is a fix related to how NinjaCentral names their NZB files. All their NZBs have a dash + four characters appended to the filename/name of the NZB. A few examples: `-ASn1` `-xm98` `-s4n4` - and so on This reg-ex/reg-ex-replace works by removing that part only. I've had this reg-ex in my clean.py script for quite a long time, and haven't observed any negative effects with using this, with a lot of different NZB indexers simultaneously. A reg-ex test: https://regex101.com/r/KD8uqu/1 --- docs/Downloaders/NZBGet/scripts/Clean/Clean.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Downloaders/NZBGet/scripts/Clean/Clean.py b/docs/Downloaders/NZBGet/scripts/Clean/Clean.py index c62997863..21232e59f 100644 --- a/docs/Downloaders/NZBGet/scripts/Clean/Clean.py +++ b/docs/Downloaders/NZBGet/scripts/Clean/Clean.py @@ -54,6 +54,7 @@ fwp = re.sub('(?i)\[TGx\]-xpost\.nzb$', '.nzb', fwp) fwp = re.sub('(?i)\[ettv\]\.nzb$', '.nzb', fwp) fwp = re.sub('(?i)-WRTEAM\.nzb$', '.nzb', fwp) fwp = re.sub('(?i)-CAPTCHA\.nzb$', '.nzb', fwp) +fwp = re.sub(r'(\-[^-.\n]*)(\-.{4})?\.nzb$', r'\1.nzb', fwp) if fwp: print('[NZB] NZBNAME=', fwp, sep='') From eb44de13dc66c981f31b58b641bdfc33ba0ba68e Mon Sep 17 00:00:00 2001 From: VP-EN <67713433+VP-EN@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:49:54 +0200 Subject: [PATCH 2/2] NinjaCentral fix (SABnzbd) This is a fix related to how NinjaCentral names their NZB files. All their NZBs have a dash + four characters appended to the filename/name of the NZB. A few examples: -ASn1 -xm98 -ga2k This reg-ex/reg-ex-replace works by removing that part only. I've had this reg-ex in my clean.py script for quite a long time, and haven't observed any negative effects with using this, with a lot of different NZB indexers simultaneously. A reg-ex test: https://regex101.com/r/fpsQqh/1 --- docs/Downloaders/SABnzbd/scripts/Clean/Clean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py b/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py index 87f0e4294..9848e0f50 100644 --- a/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py +++ b/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py @@ -49,7 +49,7 @@ fwp = re.sub('(?i)\[ettv\]$', '', fwp) fwp = re.sub('(?i)\[TGx\]-xpost$', '', fwp) fwp = re.sub('(?i).mkv-xpost$', '', fwp) fwp = re.sub('(?i)-xpost$', '', fwp) - +fwp = re.sub(r'(\-[^-.\n]*)(\-.{4})?$', r'\1', fwp) print("1") # Accept print(fwp) print() @@ -58,4 +58,4 @@ print() print() print() # 0 means OK -sys.exit(0) \ No newline at end of file +sys.exit(0)