Page 1 of 1

using API to download password encrypted files

Posted: October 11th, 2013, 3:21 am
by mordret
Hi,

I use the following API call to let my sab download movies that are PW encrypted
url = sHost;
url += "/sabnzbd/api?mode=addurl";
url += "&apikey=" + sApiKey;
url += "&name=" + urlNzb;
url += "&nzbname=" + sMovieName;
url += "/" // <-- no matter how I encode this I get a plus sign
url += sPassword;

No matter how I econde the forward slash my sab will put a plus sign instead making the download fail.
Any idea?

thx

Re: using API to download password encrypted files

Posted: October 14th, 2013, 1:17 pm
by shypike
Use % code.
A slash would be %2F
http://www.w3schools.com/tags/ref_urlencode.asp

Re: using API to download password encrypted files

Posted: October 21st, 2013, 1:02 am
by mordret
Thanks shypike, however I also used %2F and it got replaced with "+".
I am running version: 0.6.15 is it possible that an upgrade solves the issue?

Re: using API to download password encrypted files

Posted: October 22nd, 2013, 5:26 am
by shypike
mordret wrote:Thanks shypike, however I also used %2F and it got replaced with "+".
That's because a '/' cannot be part of a file name on any operating system.

Re: using API to download password encrypted files

Posted: October 22nd, 2013, 7:59 am
by mordret
Thanks for your reply. I finally solved the issue by loading the sab webinterface in an iframe and changing the + to a forward slash via javascript loool, well ugly perhaps but it does the trick :)

Re: using API to download password encrypted files

Posted: January 16th, 2014, 9:38 am
by afly
would it be worth considering using a different character to denote the password? or interpret a / char as literal so it can be utilised

The api essentially doesn't support it at all as it stands

Re: using API to download password encrypted files

Posted: January 18th, 2014, 6:54 am
by shypike
There was a bug in SABnzbd that "sanitized" passwords coming from the "nzbname" parameter.
This will be fixed in 0.7.17

Re: using API to download password encrypted files

Posted: January 18th, 2014, 7:03 am
by afly
fantastic news :)

Re: using API to download password encrypted files

Posted: January 20th, 2014, 4:41 am
by mordret
Great! that's good news indeed!