Friday, February 19, 2010

SABnzbd Java API

For all you SABnzbd fans, i've got a real treat for you. I've just put together a Java API (must admit didn't take long) to support various functions that SABnzbd supports. Here is a sneak preview of what you will be able to do with the API:



String[] nzbs =
{"http://www.newzbin.com/browse/post/5569239/nzb",
"http://www.newzbin.com/browse/post/5568352/nzb"};

String sabURL= "http://sabserverurl";
SABnzbd mySabServer= new SABnzbd(sabURL, "uname", "pwd");

System.out.println("Current download speed: " + mySabServer.getDownloadSpeed());

for(String nzb: nzbs)
{
mySabServer.download(nzb);
}

List queue = mySabServer.getQueue();

if (queue.isEmpty()) {
System.out.println("No download entries");
} else {
for (QueueEntry qu : queue) {
System.out.println("---- New Entry --- ");
System.out.println("Category: " + qu.getCategory());
System.out.println("Name: " + qu.getName());
System.out.println("Reamining " + qu.getRemain());
System.out.println("Total:" + qu.getTotal());
System.out.println("ETA: " + qu.getEta());
}
}

7 comments:

Simon said...

I'd be super interested in a Blackberry client. I've been using Sabnzb for years now and it's brilliant but since I left the iPhone have been without an app for it.

Happy to test for you, I have a Bold 9700

Si

wflammenspeck said...

I would also be interested in a Blackberry client. Let me know if you need a tester.

Cheers

Simon said...

You got anywhere with this ?

Frank said...

I'd love to have this feature on my phone. with watchdog, this, sabnzbd+ .. and my busy life, it would be perfect.

AMiB said...

I too have recently discovered the magic of SABnzbd and would be happy to test it on my Bold 9700.

Email me: veerthetiguy AT sbcglobal DOT net

Thanks :-)

Jacob Tabak said...

Adam, are you still working on this API?

Thanks,
Jacob Tabak

hbpo said...

A blackberry client would be great!

I have a Bold 9700, and would be happy to test plugins for you.