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
Pre_Process Script
Re: Pre_Process Script
OK. How far have you gotten in creating your script? Can you post it?Spritzup wrote: I'm looking to create a pre-process script ...
... 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
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.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.
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
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
That worked wonderfully, thank you! Is their anyway to combine this with checking the priority of shows grabbed by sickbeard?sander wrote: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
Thanks again!
Cheers,
~Spritz
Re: Pre_Process Script
... 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.Spritzup wrote:That worked wonderfully, thank you! Is their anyway to combine this with checking the priority of shows grabbed by sickbeard?sander wrote: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
That is exactly right. Thank you!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.
~Spritz
Re: Pre_Process Script
This works with my simple testing:
Result:
HTH
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
Code: Select all
$ ./pre-queue-script.py 'The Playing Boy S01e01' '' 'TV' '' '1' '598510865' 'alt.binaries.boneless' 'The Playing Boy' '1' '1' ''
1
2
Re: Pre_Process Script
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
~Spritz