Page 1 of 1
API addurl problem
Posted: March 9th, 2013, 4:26 am
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
Re: API addurl problem
Posted: March 9th, 2013, 5:07 am
by shypike
Not every site supports https.
Re: API addurl problem
Posted: March 9th, 2013, 6:43 am
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.
Re: API addurl problem
Posted: March 9th, 2013, 7:36 am
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.
Re: API addurl problem
Posted: March 9th, 2013, 8:06 am
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.
Re: API addurl problem
Posted: March 9th, 2013, 9:39 am
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.
Re: API addurl problem
Posted: March 9th, 2013, 10:50 am
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!
Re: API addurl problem
Posted: March 9th, 2013, 11:44 am
by shypike
Can you PM me an example URL so that I can test myself?