Page 1 of 1
Re: Add by URL through API Nzb.su
Posted: November 6th, 2011, 7:43 am
by shypike
How do you send the URL to SABnzbd?
Re: Add by URL through API Nzb.su
Posted: November 6th, 2011, 12:05 pm
by giejay
String urlString = V.baseURLsab + "/api?mode=addurl&output=xml&apikey=" + V.APIkeysab+ "&name="+downloadURL;
URL url = new URL(urlString);
URLConnection urlC = url.openConnection();
urlC.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 (.NET CLR 3.5.30729)");
return urlC.getInputStream();
Re: Add by URL through API Nzb.su
Posted: November 6th, 2011, 3:02 pm
by shypike
You need to quote all meta characters in the nzb.su URL.
So a space becomes %20, etc.
Re: Add by URL through API Nzb.su
Posted: November 6th, 2011, 4:29 pm
by giejay
Ok, so now I'm sending this URL for example:
http://sabnzbd:90/sabnzbd/api?mode=addu ... zbSuApikey
Still a no-go, I'm getting this result:
http://nzb.su/getnzb/8e2e8e19c1dc61af15d8dce0d8ca0.nzb ยป URL Fetching failed; Unusable NZB file, Try again
Re: Add by URL through API Nzb.su
Posted: November 7th, 2011, 3:08 am
by shypike
URL quoting for & isn't & it's %26
What you're using is HTML quoting, which is something completely different.
Illustration:
http://old.zope.org/Members/4am/url_quoting
Re: Add by URL through API Nzb.su
Posted: November 7th, 2011, 3:25 am
by giejay
That's it, it works perfectly now, thank you so much!