Add by URL through API Nzb.su

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Add by URL through API Nzb.su

Post by shypike »

How do you send the URL to SABnzbd?
giejay
Newbie
Newbie
Posts: 6
Joined: November 6th, 2011, 3:59 am

Re: Add by URL through API Nzb.su

Post 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();
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Add by URL through API Nzb.su

Post by shypike »

You need to quote all meta characters in the nzb.su URL.
So a space becomes %20, etc.
giejay
Newbie
Newbie
Posts: 6
Joined: November 6th, 2011, 3:59 am

Re: Add by URL through API Nzb.su

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Add by URL through API Nzb.su

Post 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
giejay
Newbie
Newbie
Posts: 6
Joined: November 6th, 2011, 3:59 am

Re: Add by URL through API Nzb.su

Post by giejay »

That's it, it works perfectly now, thank you so much!
Post Reply