Question about using the 'Add by Url' api

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
NzbPewPew
Newbie
Newbie
Posts: 2
Joined: March 21st, 2012, 6:43 am

Question about using the 'Add by Url' api

Post by NzbPewPew »

Hi folks,

I'm reading the api wiki about how to add an nzb via url.

The docs say this: -

Shortest way:

Code: Select all

URL: api?mode=addurl&name=http://www.example.com/example.nzb&nzbname=NiceName
The url i want to try and parse is

Code: Select all

https://www.pewpew.asadsa/api?t=get&guid={0}&apikey={1}&o=json
notice how my url has a few extra params? is that ok?

cause that means, i would need to do this... and i'm not sure if this is right ..


Code: Select all

URL: api?mode=addurl&name=https://www.pewpew.asadsa/api?t=get&guid={0}&apikey={1}&o=json&nzbname=NiceName
(of course, i would replace {0} and {1} with the correct info ...

so .. can that work?

(i'm at work, and can't try this .. so i was hoping someone can confirm for me, please).

-ce moi-
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Question about using the 'Add by Url' api

Post by shypike »

You need to do proper URL quoting, where you replace all meta-characters by %00 symbols.
https://www.pewpew.asadsa/api?t=get&gui ... {1}&o=json
will become:
https%3A%2F%2Fwww.pewpew.asadsa%2Fapi%3Ft=get%26guid={0}%26apikey={1}%26o=json
NzbPewPew
Newbie
Newbie
Posts: 2
Joined: March 21st, 2012, 6:43 am

Re: Question about using the 'Add by Url' api

Post by NzbPewPew »

ya. confirmed to work.

(I would have never thought about url encoding that param).

Woot!
Post Reply