Uploading NZB With API.
Forum rules
Help us help you:
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.
Uploading NZB With API.
I'm working on a PyQt Gui app for SAB, and I'm having a hard time with uploading nzb files. I've the perl example that was posted here a long time ago, but I'm looking for some sort of python example. I've tried all sorts of things from urllib and pycurl but haven't had any success. does anyone have an example of uploading an nzb file with python?
Re: Uploading NZB With API.
The fileupload is a pretty painful thing to do with the api.
You can try using this library http://fabien.seisen.org/python/urllib2_multipart.html
to send the nzb file, however personally I caved and just added an API function for version 0.5 that just requires the local file path to add to sabnzbd.
I'm quite interested in what you are working on, care to share more details or screenshots?
You can try using this library http://fabien.seisen.org/python/urllib2_multipart.html
to send the nzb file, however personally I caved and just added an API function for version 0.5 that just requires the local file path to add to sabnzbd.
Code: Select all
-addlocalfile
http://localhost:8080/sabnzbd/api?mode=addlocalfile&name=c%3A%0Cile%20name.nzbRe: Uploading NZB With API.
I dont have much yet, but What i want is just something that sits in the system tray, and can pop up a window showing the current queue, and allow dropping nzb files (or urls to nzb files) into the window to automatically add them to the queue. I have SABnzbd running on my server and i'll be running the gui app on the other computers in the house (one mac, one linux) so i'd really like to get the upload functionality working. the linux machine has the NZB Scan directory mounted, but the mac doesn't, so It would be really useful to get the upload functionality.switch wrote: The fileupload is a pretty painful thing to do with the api.
You can try using this library http://fabien.seisen.org/python/urllib2_multipart.html
to send the nzb file, however personally I caved and just added an API function for version 0.5 that just requires the local file path to add to sabnzbd.
I'm quite interested in what you are working on, care to share more details or screenshots?Code: Select all
-addlocalfile http://localhost:8080/sabnzbd/api?mode=addlocalfile&name=c%3A%0Cile%20name.nzb
I actually did try the code you linked to and I couldn't get that to work either.
maybe i'm passing in the wrong variables or something, does the &name= have to match the name of the uploaded file?
when i have something more usable I'll post more info about it.
Last edited by andre_pl on May 9th, 2009, 3:58 pm, edited 1 time in total.
Re: Uploading NZB With API.
I was able to get the file uplaod to work using this code:
http://odin.himinbi.org/MultipartPostHandler.py
i should have some code to share some time tomorrow.
http://odin.himinbi.org/MultipartPostHandler.py
i should have some code to share some time tomorrow.

