Page 1 of 1

Looking for Sabnzbd API info

Posted: July 6th, 2011, 1:18 am
by J03 8LACK
Any help would be great.

I'm writing a little script in python to run after sabnzbd finishes downloading but I'm getting noname errors. I'm using sabnzbd API to find the movie name from the history output and stripping it from the <Storage> tags. But I seem to be trying to find the tag before its there.

Question
Is the API history info written before the post-processing script is run. ( note I do have movie sorting enabled in sabnzbd .. maybe this slows it down)

just a side note if i Run the script after it errors out manually (after waiting) the script runs fine.

i will write a delay in the script maybe that will get it run correctly

Any info would be great
J03

PS I cant find any API info on this forum and I did try the search.

Re: Looking for Sabnzbd API info

Posted: July 6th, 2011, 1:28 am
by shypike
Google is your friend, the simple search for "SABnzbd api" gave me this:
http://wiki.sabnzbd.org/api

The documentation isn't great, but usable.

Re: Looking for Sabnzbd API info

Posted: July 9th, 2011, 5:40 pm
by J03 8LACK
Thanks shypike,

I had already found the wiki page but its missing info about the processing of the API that I'm looking for.

http://localhost:8080/sabnzbd/api?mode= ... apikeyhere

I have found out the the Start and limit can be adjusted to your specification, in my case i need the last downloaded info limit=1

but it seems the history output XML is not written until the the post processing script has run. I thinks that's why my script is getting errors because the API history output XML is not there when the script is ran.

I'm going to create a script to call my other script with a delay in hopes that this solves the problem.

J03

Re: Looking for Sabnzbd API info

Posted: July 12th, 2011, 10:39 pm
by J03 8LACK
Problem solved:

I was correct in thinking the history output XML is not written until the the post processing script had run.

So by adding a small batch file to run the Start cmd on the python script it ran fine. I'm not sure if there is a similar process in python that can be written in the script itself. but it needs to start a script then return without waiting for the script to finish so Sabnzbd API xml file can be processed.

Take a look at the results.
Folder.jpg Movie Poster Grabber Script - http://forums.sabnzbd.org/viewtopic.php?f=9&t=8291

J03