Page 1 of 1

Did the post processing API change?

Posted: May 17th, 2011, 6:25 am
by gitar
Hi there!

It seems to me that the post processing API changed somehow. When I try to get parameters with sys.argv in a python post-processing-script the sys.argv list comes back with only sys.argv[0] which won't help me much.

I did look up the user-script-wiki at wiki.sabnzbd.org/user-scripts and tried calling my python script with a cmd file like so:

Code: Select all

C:\Python32\python.exe C:\Users\gitar\AppData\Local\sabnzbd\scripts\working\mysab.py %1 %2 %3
^^ This worked. (I only really need %1 and %3 for my script)


I do remember though that I could still get sys.argv directly in sabnzbd++ versions pre 0.6., so I am not very sure what changed.


Cheers and thanks for the hard but great work you all do.

Re: Did the post processing API change?

Posted: May 17th, 2011, 9:20 am
by shypike
There were some minor changes in the implementation,
but that should have no effect on the parameters,
other than adding quotes were they are needed.
What happens if you call the Python script directly, so without the wrapper?

Re: Did the post processing API change?

Posted: May 17th, 2011, 1:33 pm
by gitar
I tried the following test_sab.py file directly:

Code: Select all

import sys

print(sys.argv)

I got following sys.argv list:

Code: Select all

['C:\\Users\\gitar\\AppData\\Local\\sabnzbd\\scripts\\working\\test_sab.py']

So all I get is the script name, and no other parameters.
I'll do some more snooping around when I have time. Don't worry too much about this, it works fine with the wrapper.