diff --git a/docs/Downloaders/SABnzbd/.pages b/docs/Downloaders/SABnzbd/.pages index a51ef9332..ba5470999 100644 --- a/docs/Downloaders/SABnzbd/.pages +++ b/docs/Downloaders/SABnzbd/.pages @@ -1,3 +1,4 @@ nav: - Basic-Setup: Basic-Setup.md - - Path and Categories: Paths-and-Categories.md \ No newline at end of file + - Path and Categories: Paths-and-Categories.md + - Scripts: /Downloaders/SABnzbd/scripts/ \ No newline at end of file diff --git a/docs/Downloaders/SABnzbd/images/sabnzbd-switches-queue-clean.png b/docs/Downloaders/SABnzbd/images/sabnzbd-switches-queue-clean.png new file mode 100644 index 000000000..3891c24c2 Binary files /dev/null and b/docs/Downloaders/SABnzbd/images/sabnzbd-switches-queue-clean.png differ diff --git a/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py b/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py new file mode 100644 index 000000000..87f0e4294 --- /dev/null +++ b/docs/Downloaders/SABnzbd/scripts/Clean/Clean.py @@ -0,0 +1,61 @@ +#!/usr/bin/python3 -OO + +################################################################## +### SABnzbd - Clean NZB Renamer ## +################################################################## +## NOTE: This script is considered ALPHA! ## +## ## +## Removes the suffixes from NZB name used by bots: ## +## examples: NZBgeek / Obfuscated / BUYMORE / Scrambled, etc.. ## +## ## +## NOTE: This script requires Python 3 ## +## ## +## Install: ## +## 1. Copy script to sabnzbd's script folder ## +## 2. run: sudo chmod +x Clean.py ## +## 3. in SABnzbd go to Config > Switches ## +## 4. Change Pre-queue user script and select: Clean.py ## +################################################################## + +import sys +import re + +try: + (scriptname, nzbname, postprocflags, category, script, prio, downloadsize, grouplist, showname, season, episodenumber, episodename) = sys.argv + downloadsize = int(downloadsize) +except: + sys.exit(1) # exit with 1 causes SABnzbd to ignore the output of this script + +fwp = nzbname +fwp = re.sub('(?i)-4P$', '', fwp) +fwp = re.sub('(?i)-4Planet$', '', fwp) +fwp = re.sub('(?i)-AsRequested$', '', fwp) +fwp = re.sub('(?i)-AsRequested-xpost$', '', fwp) +fwp = re.sub('(?i)-BUYMORE$', '', fwp) +fwp = re.sub('(?i)-Chamele0n$', '', fwp) +fwp = re.sub('(?i)-GEROV$', '', fwp) +fwp = re.sub('(?i)-iNC0GNiTO$', '', fwp) +fwp = re.sub('(?i)-NZBGeek$', '', fwp) +fwp = re.sub('(?i)-Obfuscated$', '', fwp) +fwp = re.sub('(?i)-postbot$', '', fwp) +fwp = re.sub('(?i)-Rakuv$', '', fwp) +fwp = re.sub('(?i)-Scrambled$', '', fwp) +fwp = re.sub('(?i)-WhiteRev$', '', fwp) +fwp = re.sub('(?i)-WRTEAM$', '', fwp) +fwp = re.sub('(?i)-CAPTCHA$', '', fwp) +fwp = re.sub('(?i)\[eztv\]$', '', fwp) +fwp = re.sub('(?i)\[TGx\]$', '', fwp) +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) + +print("1") # Accept +print(fwp) +print() +print() +print() +print() +print() +# 0 means OK +sys.exit(0) \ No newline at end of file diff --git a/docs/Downloaders/SABnzbd/scripts/index.md b/docs/Downloaders/SABnzbd/scripts/index.md new file mode 100644 index 000000000..6aa738b7d --- /dev/null +++ b/docs/Downloaders/SABnzbd/scripts/index.md @@ -0,0 +1,28 @@ +# SABnzbd Scripts + +## Clean + +??? info "Clean NZB name" + + - Title: `Clean.py` + - Author(s): ??? + - Made compatible for SABnzbd: AlexK + + Removes the following suffixes from NZB name: + NZBgeek / Obfuscated / BUYMORE / Scrambled /etc... + Cleans the NZB name by removing the retagged stuff (-Obfuscated, -postbox, etc). + + Install Instructions: + + 1. Copy script to sabnzbd's script folder + 1. run: `sudo chmod +x Clean.py` + 1. in SABnzbd go to `Settings` => `Switches` + 1. Change Pre-queue user script and select: `Clean.py` + + ![!Enable Clean.py](/Downloaders/SABnzbd/images/sabnzbd-switches-queue-clean.png) + +??? example "Script" + + ```python + [[% filter indent(width=4) %]][[% include 'Downloaders/SABnzbd/scripts/Clean/Clean.py' %]][[% endfilter %]] + ```