Vista Sidebar Gadget

Got a program that plays well with SABnzbd? Share it here!
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

here an screenshot of how the ETA is displayed.
is this good enough for you guys?

;)
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
KaiUno
Newbie
Newbie
Posts: 45
Joined: January 23rd, 2008, 6:56 am

Re: Vista Sidebar Gadget

Post by KaiUno »

Great to see you're back in business! It's been exactly 2 months since I started using your gadget and it hasn't skipped a beat so far.

Keep it up, Piet!
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

pair of dimes wrote: What do you think about only showing the progress bar for the active download, not for the others?
This could be done but won't you need that information? it will be a bit cleaner tough.

KaiUno wrote: Great to see you're back in business! It's been exactly 2 months since I started using your gadget and it hasn't skipped a beat so far.

Keep it up, Piet!
Thanks!
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
kizer8
Newbie
Newbie
Posts: 38
Joined: April 21st, 2008, 7:00 am

Re: Vista Sidebar Gadget

Post by kizer8 »

Any new version, yet?
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

kizer8 wrote: Any new version, yet?
nothing ready to be released :P
lol sometimes i allmost release with my username and password hardcoded in the javascript ;)
i am working on the uploading of nzb's now and its a bit tricky but with the new found code it should not be a big problem.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

switch wrote: You need to be sending the full contents of the nzb files through as a post request.

Have a look at nzbdstatus' implementation for a working example, ctrl+f to "uploadFile:" (be sure to give credit if you use it).
i think i allmost edited the function to work with the gadget but i am stuck with:

Code: Select all

this.getPreference('filesToSAB')
on row 964:
https://nzbdstatus.bountysource.com/svn ... tus.js#964

what kind of information is stored in filesTOSAB?
i cant see a getPreference('filesToSAB', ........); anywhere.

this is what the request body is going to look like as far as i know.
what comes below.


----------2436264
Content-Disposition: form-data; name="name"; filename="test.nzb"
Content-Type: application/octet-stream

(Binary Data)
----------2436264
Content-Disposition: form-data; name="pp"

filesToSAB???
----------2436264--
note the ------2436264 is not correct, i made up those numbers

does anyone know what kind of goes in place of the bold text?

Thanks!

i never knew javascript could do such cool things :D
Last edited by pieteckhart on September 20th, 2008, 3:50 am, edited 1 time in total.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Vista Sidebar Gadget

Post by switch »

I believe it is just the post-processing option, from -1 to 3
-1 Default for the category/default set in switches
0 None
1 Unpack
2 Repair
3 Delete

Attached is an example request:
http://sabnzbd.org/switch/example1.txt
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

switch wrote: I believe it is just the post-processing option, from -1 to 3
-1 Default for the category/default set in switches
0 None
1 Unpack
2 Repair
3 Delete

Attached is an example request:
http://sabnzbd.org/switch/example1.txt
Thanks Switch!

the example was very usefull!
i can now sent to the API :)
but i ran into another problem!

when i sent to the API i get 500: Internal Server Error.
500 Internal error
The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "cherrypy\_cphttptools.pyo", line 114, in _run
  File "cherrypy\_cphttptools.pyo", line 240, in processBody
  File "cherrypy\_cpcgifs.pyo", line 8, in __init__
  File "cgi.pyo", line 534, in __init__
  File "cgi.pyo", line 659, in read_multi
  File "cherrypy\_cpcgifs.pyo", line 8, in __init__
  File "cgi.pyo", line 536, in __init__
  File "cgi.pyo", line 669, in read_single
  File "cgi.pyo", line 691, in read_lines
  File "cherrypy\_cpcgifs.pyo", line 31, in read_lines_to_outerboundary
  File "cherrypy\lib\httptools.pyo", line 529, in readline
  File "socket.pyo", line 373, in readline
timeout: timed out
i tried to post to a simple php script and got a correct response:
Contents of S_POST Array:
Array
(
    [cat] => apps
    [pp] => -1
    [script] => Default
)

i also tried with only pp leaving out cat and script.

Contents of S_FILES Array:
Array
(
    [name] => Array
        (
            [name] => hancock.nzb
            [type] => application/x-nzb
            [tmp_name] => C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\php4B.tmp
            [error] => 0
            [size] => 254512
        )

)
i use 'name' instead of 'nzbfile', i think 'nzbfile' was used in older versions?

i'm posting like described in the wiki
http://host:port/sabnzbd/?mode=addfile&name=filename.nzb&ma_username=user&ma_password=pass

Thanks Again.
Last edited by pieteckhart on July 8th, 2008, 7:11 am, edited 1 time in total.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

i notice that the referer is set to 'x-gadget:///gadget.html'. but i did set the Request Header.
does the API check the referer? maybe thats the problem.

EDIT: after looking at the code in _cpcgifs.py i think it has something todo with the outerboundary (ends with --)

don't know whats wrong with it because it looks fine to me:
-----------------------------1215540058496
Content-Disposition: form-data; name="name"; filename="Meet Bill.nzb"
Content-Type: application/x-nzb




... bla bla ...

-----------------------------1215540058496
Content-Disposition: form-data; name="cat"

apps
-----------------------------1215540058496
Content-Disposition: form-data; name="pp"

-1
-----------------------------1215540058496
Content-Disposition: form-data; name="script"

Default
-----------------------------1215540058496--
as you can see i did not post the 'Content-Type' and 'Content-Length' part.
this is because i don't know how to get those after sending them (the above is just the contents of the body variable before it is sent)

@Switch: How did you get the neat output as in http://sabnzbd.org/switch/example1.txt ?
(i mean how did you get the first 2 lines? i need those to check if they are set correctly)

if the headers are not sent to the server correctly the boundary is not known.
and that could be the problem for the error? or maybe i am miles away from the solution, would not be the first time ;)

btw: sorry all for spamming this topic with technical information!
i will post a new version once the upload works!
Last edited by pieteckhart on July 8th, 2008, 1:14 pm, edited 1 time in total.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

i got it :D

after the final boundary there needs to be a blank row! so i added a \n and it works :D

thanks for the help switch! i will give credit to you and the example code once i have an about window ;)

i will make a new release now for you you all test!
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Vista Sidebar Gadget

Post by switch »

No worries, glad you got it working.

The credit for the example code should go to Duz, the creator of nzbdstatus. I believe his code is licensed under the GPL.
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

switch wrote: No worries, glad you got it working.

The credit for the example code should go to Duz, the creator of nzbdstatus. I believe his code is licensed under the GPL.
Ok thanks, now i know how to give credit to :P new release in few minutes i hope :)
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

Release: 1.0.0.2
Download: http://www.sab.websijt.net/sab.gadget

Added:
1. Upload nzb's by drag and drop (support for multiple nzb's at once)
2. Status Windows with information
3. new button (the round one) that opens your browser to the web interface.
4. bugfixes and some cleaning up.

EDIT:
5. You now can choose a category for the newly added downloads
6. You can try the connection by hitting the button in the settings popup (See Image)
Last edited by pieteckhart on July 9th, 2008, 5:17 am, edited 1 time in total.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

I was reading on http://sabnzbd.wikidot.com/api#toc3
about the feature of the API.

the "Advanced Queue Output" would mean a lot to the Gadget!

i now use the depricated "Simple Queue Output" wich will only show me active downloads.
The new Advanced Output will allso give infomation about finishing Jobs (like when a job is extracting or Checked).

so when the new API gets released i am going to convert to the new Output.

this also means i am not going to implement a history view in the gadget (becouse the information needed is already in the new queue outout).
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
User avatar
pieteckhart
Release Testers
Release Testers
Posts: 131
Joined: April 30th, 2008, 9:34 am
Location: Netherlands
Contact:

Re: Vista Sidebar Gadget

Post by pieteckhart »

pair of dimes wrote: Awesome, I love the "try connection" button. Uploading multiple nzbs sounds great too.

Can you run multiple instances of this gadget no problem?
Do you have a screenshot of the gadget with nzbs downloading inside of it?

One note, you might want to make the download speed label "KB/s" as to represent kilobytes (kb is kilobits).
yes multiple works great, every sidebar has its own settings variables. but if you restart your computer everything is back to default (localhost:8080 no user/pass). i still need code a way of saving the settings but that would mean that after restarting all gadgets will have the same setting. maybe i could create a workaround.

i will make some screenshots in a few minutes!

oh and your right about the kbs ;) the variable in the JSON string from the API was lowercase so i did not think about is ;)

something else:
i just installed the vista sidebar in Windows XP :D gadget allso works fully there.

EDIT: Here is the screenshot
Last edited by pieteckhart on July 11th, 2008, 4:06 pm, edited 1 time in total.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
Post Reply