Adding Nzb From Android

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
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Adding Nzb From Android

Post by potman100 »

Hi

I'm trying to upload a Nzb file to sab via the api from Android.

I've look all around the net and can't find an answer.

Thanks for any help.

Regards

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

Re: Help With Categories

Post by shypike »

"via the api"?
You mean you have some Android app?
Did you set it up properly?
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Re: Adding Nzb From Android

Post by potman100 »

Hi

Yes, I have an android app, that I can download Nzb files to the device, the problem I have is I
need to send the nzb from the app to sab.

I think its a http post request via mode=addfile but Im not sure.

Regards

Potman
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Re: Adding Nzb From Android

Post by potman100 »

Hi shypike

Any ideas on this ?

Sabcontrol on android can do it, I just can't seem to find out how.

The app has over 700,000 Nzbs avaliable, with a couple of thousand being added daily, and they all come direct from
Usenet.

Regards

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

Re: Adding Nzb From Android

Post by shypike »

I can give you the CURL command to accomplish it.
This should give you an idea how to do it.

Code: Select all

curl http://host:8080/sabnzbd/api -F apikey=APIKEY -F mode=addfile -F output=json -F "name=@d:\path\to\my\file.nzb"
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Re: Adding Nzb From Android

Post by potman100 »

Hi

thanks for the info, not really used curl in the past but will see If I can get if working.

Regards

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

Re: Adding Nzb From Android

Post by shypike »

Curl has some options to show what it is actually sending and receiving.
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Re: Adding Nzb From Android

Post by potman100 »

Hi

I've managed to craft a http post in basic4android, and when I check the sab logs
it matches the log entry's for the same file added by curl.

The curl one works and adds to sab and gives the return code

{"status":true,"nzo_ids":["SABnzbd_nzo_allw_s"]}

but the b4a fails with

{"status":false,"nzo_ids":[]}

Any idea what this error means ?

Regards

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

Re: Adding Nzb From Android

Post by shypike »

The "b4a" ?
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Re: Adding Nzb From Android

Post by potman100 »

basic4android application
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Help With Categories

Post by shypike »

The error means that no usable nzb file was received.
potman100
Newbie
Newbie
Posts: 13
Joined: June 14th, 2012, 2:16 pm

Re: Adding Nzb From Android

Post by potman100 »

Hi shypike

Thanks for your help with this, got it working now, the issue was when reading
the nzb for the post request, there was a \r\n being added to the nzb post data,
which was making the nzb data invalid.

Regards

Potman
Post Reply