Page 1 of 1
Pauze sabnzbd from commandline?
Posted: January 14th, 2011, 4:55 am
by beukie
I was wondering if it was possible to pause sabnzbd from the commandline on linux?
The reason I ask is because I use a lot of rssfeeds for downloading and I like playing ps3, downloading and playing online games don't really match so i made a script that pings my ps3 to see if it runs and if so it stops sabnzbd (/etc/rc.d/sabnzbd stop), although that works it would probably be nicer if I could pause downloading instead of stopping sabnzbd altogether, any suggestions?
Re: Pauze sabnzbd from commandline?
Posted: January 14th, 2011, 5:09 am
by shypike
Use an API call with wget or curl
Code: Select all
curl http://localhost:8080/api?mode=pause&apikey=APIKEY
You can find the APIKEY in Config->General
There's some documentation about the API here:
http://wiki.sabnzbd.org/api
Re: Pauze sabnzbd from commandline?
Posted: January 14th, 2011, 7:34 am
by beukie
Thanks shypike that worked great!
Re: Pauze sabnzbd from commandline?
Posted: May 20th, 2014, 10:30 am
by weybfr
shypike wrote:Use an API call with wget or curl
Code: Select all
curl http://localhost:8080/api?mode=pause&apikey=APIKEY
You can find the APIKEY in Config->General
There's some documentation about the API here:
http://wiki.sabnzbd.org/api
hello,
I'm not as lucky as
beukie, as i tried many commands & didn't succeed...
I'm a newbie with linux, so I copied what
shypike wrote, and I tried :
Code: Select all
>>wget http://localhost:8080/api?mode=pause&apikey=<APIKEY>
>> --17:13:16-- http://localhost:8080/api?mode=pause
=> `api?mode=pause'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24 [text/plain]
api?mode=pause: Permission denied
Cannot write to `api?mode=pause' (Permission denied).
I thought I forgot the
/sabnzbd directory, so I tried :
Code: Select all
>> wget http://localhost:8080/sabnzbd/api?mode=pause&apikey=<APIKEY>
>> --17:13:45-- http://localhost:8080/sabnzbd/api?mode=pause
=> `api?mode=pause'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24 [text/plain]
api?mode=pause: Permission denied
Cannot write to `api?mode=pause' (Permission denied).
I tried to know what is the authentication mode :
Code: Select all
>> wget http://localhost:8080/sabnzbd/api?mode=auth
--17:14:15-- http://localhost:8080/sabnzbd/api?mode=auth
=> `api?mode=auth'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7 [text/plain]
api?mode=auth: Permission denied
Cannot write to `api?mode=auth' (Permission denied).
so i changed "wget" to "curl" :
Code: Select all
>> curl http://localhost:8080/sabnzbd/api?mode=auth
apikey
>> curl http://localhost:8080/sabnzbd/api?mode=pause&apikey=<APIKEY>
>> error: API Key Required
>>
so :
- it seems that the authentication mode is "apikey"
- but i can't do anything as if i didn't give the apikey !
and I can't desactivate the api key on the config/general page (it says "failure")
I don't understand what i'm doing wrong...
a huge thank you very much in advance for your help !
kind regards,
Re: Pauze sabnzbd from commandline?
Posted: May 20th, 2014, 2:31 pm
by shypike
Curl works a bit different:
Code: Select all
curl http://localhost:8080/sabnzbd/api -F apikey=APIKEY -F mode=pause
Re: Pauze sabnzbd from commandline?
Posted: May 20th, 2014, 2:56 pm
by sander
Isn't this about not using single quotes? Examples how to use it:
Code: Select all
sander@flappie:~$ wget 'http://localhost:8080/api?mode=pause' -o /dev/null -O-
ok
sander@flappie:~$
Code: Select all
sander@flappie:~$ lynx --dump 'http://localhost:8080/api?mode=pause'
ok
sander@flappie:~$
Code: Select all
sander@flappie:~$ curl 'http://localhost:8080/api?mode=pause'
ok
sander@flappie:~$
Re: Pauze sabnzbd from commandline?
Posted: May 21st, 2014, 2:34 am
by jcfp
Without proper quoting, the & would background the process and the remainder of the url (i.e., the api key) no longer send to sab. There would have been indications in the output pointing to all that though, I guess weybfr was posting only very selective parts.
Re: Pauze sabnzbd from commandline?
Posted: May 21st, 2014, 1:52 pm
by weybfr
sander wrote:Isn't this about not using single quotes? Examples how to use it:
...
Code: Select all
sander@flappie:~$ curl 'http://localhost:8080/api?mode=pause'
ok
sander@flappie:~$
hi everyone !
yes it worked with the quotes !
i didn't try the other proposed solutions as this one worked fine for me !
@jcfp : no i didn't post very selective parts of the output, i only hid my apikey...
so ?
i'll try to remember that the "&" would background the process !
thank you very much everybody for your quick help !
kind regrds
weybfr