Page 1 of 1
Pre_Process Script
Posted: April 20th, 2014, 9:22 pm
by Spritzup
Good Evening,
I'm looking to create a pre-process script that would do 2 things (both changing the priority to "force"). The first is to have any file added that's less than 50MB in size to be set to force. The second part of the script would be to check for anything that has category "TV" and that is set to "High" and change it to "Force".
Any assistance that you guys could provide would be very much appreciated.
Thanks!
~Spritz
Re: Pre_Process Script
Posted: April 21st, 2014, 12:18 am
by sander
Spritzup wrote:
I'm looking to create a pre-process script ...
OK. How far have you gotten in creating your script? Can you post it?
... or do you mean you want someone else to create the script for you? If so: I'm willing to write as long as it's in python.
Re: Pre_Process Script
Posted: April 21st, 2014, 8:54 am
by Spritzup
sander wrote:
OK. How far have you gotten in creating your script? Can you post it?
... or do you mean you want someone else to create the script for you? If so: I'm willing to write as long as it's in python.
I've simply sketched out some rough logic for it on a scrap of paper. I used to write bash scripts on a regular basis, but haven't done it in years.
And if you're offering to write me one, I would not say no... my one year old has decided that sleep is for the weak. And python is more than fine.
Thanks again!
~Spritz
Re: Pre_Process Script
Posted: April 21st, 2014, 9:02 am
by sander
See the python script on
http://wiki.sabnzbd.org/user-pre-queue-script ... does that work for you, as in: the pre-queue script *forces* <50MB downloads to be downloaded
Re: Pre_Process Script
Posted: April 21st, 2014, 9:37 am
by Spritzup
That worked wonderfully, thank you! Is their anyway to combine this with checking the priority of shows grabbed by sickbeard?
Thanks again!
Cheers,
~Spritz
Re: Pre_Process Script
Posted: April 21st, 2014, 10:17 am
by sander
Spritzup wrote:
That worked wonderfully, thank you! Is their anyway to combine this with checking the priority of shows grabbed by sickbeard?
... is that the same as 'The second part of the script would be to check for anything that has category "TV" and that is set to "High" and change it to "Force".'? If so, I think I can make it happen.
Re: Pre_Process Script
Posted: April 21st, 2014, 2:07 pm
by Spritzup
sander wrote:... is that the same as 'The second part of the script would be to check for anything that has category "TV" and that is set to "High" and change it to "Force".'? If so, I think I can make it happen.
That is exactly right. Thank you!
~Spritz
Re: Pre_Process Script
Posted: April 22nd, 2014, 1:30 pm
by sander
This works with my simple testing:
Code: Select all
#!/usr/bin/env python
# See http://wiki.sabnzbd.org/user-pre-queue-script
# usage by SABnzbd:
# ./this-script.py 'The Playing Dead S01e01' '' '' '' '-100' '598510865' 'alt.binaries.boneless' 'The Playing Dead' '1' '1' ''
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
rcprio = -100 # Default
if (downloadsize < 50111222) or (category.lower()=="tv" and prio=="1") :
rcprio = 2
print "1" # Accept
print
print
print
print
print rcprio
print
sys.exit(0) # 0 means OK
Result:
Code: Select all
$ ./pre-queue-script.py 'The Playing Boy S01e01' '' 'TV' '' '1' '598510865' 'alt.binaries.boneless' 'The Playing Boy' '1' '1' ''
1
2
HTH
Re: Pre_Process Script
Posted: May 15th, 2014, 8:19 pm
by Spritzup
Sorry for the very late reply. I've had an interesting few weeks and this got back burnered. In any case, this script works awesome! Thank you so much, I really appreciate it
~Spritz