Set Category based on NZB name

Get help with all aspects of SABnzbd
Forum rules
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.
Post Reply
OneNonlyNova
Newbie
Newbie
Posts: 2
Joined: July 22nd, 2014, 4:54 am

Set Category based on NZB name

Post by OneNonlyNova »

Hey guys,

sorry if this is already on here somewhere but i did not find anything useful
via search...

i wrote a little programm for myself which checks some forums topics
every so often and looks for new posted nzbs... i have categorys set up
for all those different topics and would like sabnzbd to set the category
according to the nzb file name eg:

Test-abc
Test-gfd
Test-fkd

would go to category Test

Test2-fopd
Test2-ldfc
Test2-fdkm

would go to category Test2

is that possible somehow?

EDIT: forgot to say i could also create a rss feed for each category if that would help

Regards and thx in advance

Alex
User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Set Category based on NZB name

Post by sander »

Yes, that's possible.

Hints:

Code: Select all

~$ python
Python 2.7.3 (default, Feb 27 2014, 20:00:17)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> nzbname = "Test2-fdkm"
>>> nzbname.split('-')[0]
'Test2'
Combine that with the python script given on the page about SABnzbd Pre-processing script (http://wiki.sabnzbd.org/user-pre-queue-script)


So ... untested code ... :

Code: Select all

#!/usr/bin/env python

import sys

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



print "1"    # Accept
print
print
print nzbname.split('-')[0]      # Category
print
print
print

sys.exit(0)    # 0 means OK
HTH
OneNonlyNova
Newbie
Newbie
Posts: 2
Joined: July 22nd, 2014, 4:54 am

Re: Set Category based on NZB name

Post by OneNonlyNova »

well i'm a stupid idiot... just found out that i can just
save the nzb's from my programm to subfolders of the watched folder
that are named like the categories... :/

very quickly done and i did so much searching on that... :D

thanks anyways @ sander!

maybe you guys should move that from a little [1] to a full text feature!
Post Reply