Apologies in advance if this was asked before as I couldn't find it.
On the basis of title of the show or some custom regex, is there anyway I can setup a different category in Sabnzbd? Mostly my Sickbeard sends all my shows with the 'tv' category and for all intents and purposes that works great. However, for 1 or 2 different type of show I like to 'force' download right away but Sickbeard allows only one category without any filter. Is this possible for me to setup in Sabnzbd?
Thanks in advance.
Sickbeard to Sab - Different Category based on regex
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Re: Sickbeard to Sab - Different Category based on regex
This is only possible by using a Pre-Queue script (see wiki). In general when an external program sets a category for a download, that one is always used.
With a script you could still detect that category and search for the titles you want and then modify the category.
With a script you could still detect that category and search for the titles you want and then modify the category.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Sickbeard to Sab - Different Category based on regex
Thanks safihre.
Can you help me Validate whether this script makes sense part of Pre-Queue?
Does that make sense?
Can you help me Validate whether this script makes sense part of Pre-Queue?
Code: Select all
import sys
import re
try:
(scriptname, nzbname, postprocflags, category, script, prio, downloadsize, grouplist, showname, season, episodenumber, episodename) = sys.argv
nzbname = str(nzbname)
except:
sys.exit(1) # exit with 1 causes SABnzbd to ignore the output of this script
prio = -100 # Default
# Example --> The.Daily.Show.with.Trevor.Noah.2017.02.06.Keith.Ellison.Extended.1080p.CC.WEB-DL
if re.search('^The\.Daily\.Show.*', nzbname):
prio = 2
print "1" # Accept
print
print
print
print
print prio
print
# 0 means OK
sys.exit(0)Re: Sickbeard to Sab - Different Category based on regex
The script would probably need a python shebang line at the start or the operating system wouldn't know what to do.
The basic concept looks ok, though I would suggest making the part with the regex and prio change conditional on the job being in the tv category in the first place. Could also consider hardening the regex part a bit so it can deal with job names that don't have caps at the start of every word.
The basic concept looks ok, though I would suggest making the part with the regex and prio change conditional on the job being in the tv category in the first place. Could also consider hardening the regex part a bit so it can deal with job names that don't have caps at the start of every word.
Re: Sickbeard to Sab - Different Category based on regex
Thanks jcfp.
Corrected Script:
My follow up question would be, how does Sab know to run this part of pre-queue script? According to WIKI - I can add this script in my 'Post-Processing Scripts Folder' , but how does SAB know to execute this particular script as PRE-queue?
Corrected Script:
Code: Select all
#!/usr/bin/env python
import sys
import re
try:
(scriptname, nzbname, postprocflags, category, script, prio, downloadsize, grouplist, showname, season, episodenumber, episodename) = sys.argv
nzbname = str(nzbname)
category = str(category)
except:
sys.exit(1) # exit with 1 causes SABnzbd to ignore the output of this script
prio = -100 # Default
# Example --> The.Daily.Show.with.Trevor.Noah.2017.02.06.Keith.Ellison.Extended.1080p.CC.WEB-DL
if (re.search('^[Tt]he.+[Dd]aily.+[Ss]how.*, nzbname) and category == 'tv'):
prio = 2
print "1" # Accept
print
print
print
print
print prio
print
# 0 means OK
sys.exit(0)Re: Sickbeard to Sab - Different Category based on regex
My follow up question would be, how does Sab know to run this part of pre-queue script? According to WIKI - I can add this script in my 'Post-Processing Scripts Folder' , but how does SAB know to execute this particular script as PRE-queue?
Re: Sickbeard to Sab - Different Category based on regex
You select it in Config Switches, after placing it in your Scripts folder.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate

