API addurl problem

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
packetstormer
Newbie
Newbie
Posts: 14
Joined: September 17th, 2010, 9:49 am

API addurl problem

Post by packetstormer »

If I post a URL to SAB like below it will work fine and grab the URL:

http://www.myusenetsite.com/getnzb/xxxx ... xxxxxxxxxx

However, if I post this (exactly the same except in HTTPS) I get this error in SAB (DEBUG::[urlgrabber:351] No response from indexer, retry after 60 sec):

https://www.myusenetsite.com/getnzb/xxx ... xxxxxxxxxx

using curl provides the same error too!

Anyone know why? I have escaped the URL correctly in the actual post to SAB
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: API addurl problem

Post by shypike »

Not every site supports https.
packetstormer
Newbie
Newbie
Posts: 14
Joined: September 17th, 2010, 9:49 am

Re: API addurl problem

Post by packetstormer »

Yeah, I should have said this indexer site does support HTTPS though - if I add the URL via SAB's own interface (webGUI) the file gets added correctly. Pasting the HTTPS URL into my browser will also download the file correctly.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: API addurl problem

Post by shypike »

For a browser test to be valid: first make sure you're not logged in to the web site in any tab.
Make sure you're actually logged out.
packetstormer
Newbie
Newbie
Posts: 14
Joined: September 17th, 2010, 9:49 am

Re: API addurl problem

Post by packetstormer »

shypike wrote:For a browser test to be valid: first make sure you're not logged in to the web site in any tab.
Make sure you're actually logged out.
OK, I understand that but that doesn't explain why when I add the URL manually through SAB's web interface the HTTPS url gets retrieved. Posting the same URL via the SAB's API does not download it.

The browser, any browser, will download the file fine when I am logged out of the indexer site.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: API addurl problem

Post by shypike »

packetstormer wrote:but that doesn't explain why when I add the URL manually through SAB's web interface the HTTPS url gets retrieved. Posting the same URL via the SAB's API does not download it.
OK, didn't read your message carefully enough.
If it doesn't work through the API, it's possible that you're doing the quoting wrong.
Each and every meta character needs to be replaced with a %XX code.
That's : & = ?
So an API call would look like:
http://server:port/sabnzbd/api?mode=addurl&name=https%3A//mysite.com%3Fgetapi%3Dvalue%26id%3D1234232%26pw%3D645636546757

If you're already doing that, I don't have a clue.
Of course, the fact that CURL also fails, should make you suspicious.
Possibly (but this is just guessing) the site refuses any User-Agent header that's different than those of known browsers.
Both CURL and SABnzbd have an honest User-Agent header.
packetstormer
Newbie
Newbie
Posts: 14
Joined: September 17th, 2010, 9:49 am

Re: API addurl problem

Post by packetstormer »

Possibly (but this is just guessing) the site refuses any User-Agent header that's different than those of known browsers.
Thanks for your replies. I am encoding the url correctly alright. The user-agent header could explain it except then SAB wouldn't get the file through it's own GUI. Anyway I download the nzb and send it via addfile, a pain, but at least I have a workaround!
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: API addurl problem

Post by shypike »

Can you PM me an example URL so that I can test myself?
Post Reply