How to add an NZB from the command line

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
revelation60
Newbie
Newbie
Posts: 8
Joined: September 1st, 2010, 6:49 am

How to add an NZB from the command line

Post by revelation60 »

I am writing a .desktop file for sabnzbd, so I can just click on my NZBs to load them into SABnzbd. What I don't know is what URL I should call to add a file. Or should I invoke a python script?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: How to add an NZB from the command line

Post by shypike »

Which Operating System are you using?
revelation60
Newbie
Newbie
Posts: 8
Joined: September 1st, 2010, 6:49 am

Re: How to add an NZB from the command line

Post by revelation60 »

Linux.
revelation60
Newbie
Newbie
Posts: 8
Joined: September 1st, 2010, 6:49 am

Re: How to add an NZB from the command line

Post by revelation60 »

How do you do it in Windows? It must be somewhat the same, as python and the http calls are platform independent.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: How to add an NZB from the command line

Post by shypike »

On Windows SABnzbd can bind itself to the NZB extension.
I'm not sure how to do that on Linux.
From the command line you just start SABnzbd again with the nzb-path as the only parameter.
It will try to find out if another instance is running and pass the NZB.
You should either use the standard profile location ~/.sabnzbd or pass the same -f parameter as well.
Last edited by shypike on September 1st, 2010, 2:50 pm, edited 1 time in total.
revelation60
Newbie
Newbie
Posts: 8
Joined: September 1st, 2010, 6:49 am

Re: How to add an NZB from the command line

Post by revelation60 »

I can't manage to get sabnzbd to load an nzb. I tried the following things:

python /opt/sabnzbd/SABnzbd.py test.nzb
python /opt/sabnzbd/SABnzbd.py test.nzb -f /opt/sabnzbd/sabnzbd.ini
sudo su - sabnzbd -c "python /opt/sabnzbd/SABnzbd.py -f /opt/sabnzbd/sabnzbd.ini -s localhost:8080 test.nzb"

The command only has to work when there is already an instance of sabnzbd running. I hope the solution is similar to my first attempt, because I can't specify a lot of customized parameters from a file association.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: How to add an NZB from the command line

Post by shypike »

Personally I would setup a "Watched" Folder" in SABnzbd and use
a small script to copy the NZB into the Watched folder.
Associate the script with the .nzb extension.
revelation60
Newbie
Newbie
Posts: 8
Joined: September 1st, 2010, 6:49 am

Re: How to add an NZB from the command line

Post by revelation60 »

Ok. I am trying to add this feature to a package, because I am the maintainer, so setting up a folder is not really going to work. I will try adding through the API now, although I would have preferred just calling the python file.
User avatar
jcfp
Release Testers
Release Testers
Posts: 989
Joined: February 7th, 2008, 12:45 pm

Re: How to add an NZB from the command line

Post by jcfp »

Maybe this could be of use?
Post Reply