using API to download password encrypted files

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
mordret
Newbie
Newbie
Posts: 4
Joined: October 11th, 2013, 3:16 am

using API to download password encrypted files

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

Re: using API to download password encrypted files

Post by shypike »

Use % code.
A slash would be %2F
http://www.w3schools.com/tags/ref_urlencode.asp
mordret
Newbie
Newbie
Posts: 4
Joined: October 11th, 2013, 3:16 am

Re: using API to download password encrypted files

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

Re: using API to download password encrypted files

Post 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.
mordret
Newbie
Newbie
Posts: 4
Joined: October 11th, 2013, 3:16 am

Re: using API to download password encrypted files

Post 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 :)
afly
Newbie
Newbie
Posts: 9
Joined: January 22nd, 2011, 2:00 pm

Re: using API to download password encrypted files

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

Re: using API to download password encrypted files

Post by shypike »

There was a bug in SABnzbd that "sanitized" passwords coming from the "nzbname" parameter.
This will be fixed in 0.7.17
afly
Newbie
Newbie
Posts: 9
Joined: January 22nd, 2011, 2:00 pm

Re: using API to download password encrypted files

Post by afly »

fantastic news :)
mordret
Newbie
Newbie
Posts: 4
Joined: October 11th, 2013, 3:16 am

Re: using API to download password encrypted files

Post by mordret »

Great! that's good news indeed!
Post Reply