SABnzbd stats script for XChat (linux)

Got a program that plays well with SABnzbd? Share it here!
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

the adress it calls for gathering the information is autogenerated. entering your host and port will result in something like http://yourhost:yourport the /sabnzbd/ is apended by default.

so in your case host should be 192.168.0.120 and port 8090 what will end up in a line like http://192.168.0.120:8090/sabnzbd/

Whats your SABnzbd+ version and/or did you enter the right 32 digit api key?

speed and so on is taken from the api/xml output and the url includes the apikey. if you're using a version <0.4.9 it may work with an empty apikey (remove the xxxxxxxx in that case)
Last edited by lommes on July 2nd, 2009, 10:27 am, edited 1 time in total.
User avatar
Shadowtester
Newbie
Newbie
Posts: 44
Joined: July 31st, 2008, 11:04 am

Re: SABnzbd stats script for XChat (linux)

Post by Shadowtester »

I am currently using 4.7 I was going to be updating over the next couple of days during the holiday now that my Usenet que is finally empty and I have removed the xxxxxxxx from the api key but still getting the same error about not being able to retrieve the data from 192.168.0.120. The output I was seeing in xchat with just the 192.168.0.120 in the host and the 8090 in the port was not showing the directory it was just 192.168.0.120:8090
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

not seeing the directory is because of the wget error message which only returns the server.

try http://192.168.0.120:8090/sabnzbd/api?m ... output=xml in your browser, if that works try http://192.168.0.120:8090/sabnzbd/api?m ... ml&apikey= to check if the error is because of the apikey which is not needed. if it works without the apikey tell me and i will fix it.

if it works without the &apikey= at the end, you may try the file linked below. Just replace the existing sabgetdata file in your ~/.xchat2 directory and enter your data again

< 0.4.9 testing

this will check if an apikey is entered, if not no apikey will appended, same goes for username and password, like jcfp suggested below
Last edited by lommes on July 2nd, 2009, 3:38 pm, edited 1 time in total.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: SABnzbd stats script for XChat (linux)

Post by jcfp »

lommes wrote: if it works without the &apikey= at the end
Probably the wget request results in similar errors as those described in this report: http://trac2.assembla.com/SABnzbd/ticket/87 - only this time when sending the apikey var, which for obvious reasons is unknown to 0.4.7. Which could indeed be worked around by omitting apikey.
User avatar
Shadowtester
Newbie
Newbie
Posts: 44
Joined: July 31st, 2008, 11:04 am

Re: SABnzbd stats script for XChat (linux)

Post by Shadowtester »

http://192.168.0.120:8090/sabnzbd/api?m ... output=xml

Code: Select all

<queue>
<paused>False</paused>
<kbpersec>0.0</kbpersec>
<mbleft>0.0</mbleft>
<mb>0.0</mb>
<noofslots>0</noofslots>
<diskspace1>156.115810394</diskspace1>
<diskspace2>156.115810394</diskspace2>
<timeleft>0:00:00</timeleft>
<jobs>
</jobs>
</queue>
http://192.168.0.120:8090/sabnzbd/api?m ... ml&apikey=

Code: Select all

500 Internal error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/usr/local/src/SABnzbd/cherrypy/_cphttptools.py", line 126, in _run
    applyFilters('before_finalize')
  File "/usr/local/src/SABnzbd/cherrypy/filters/__init__.py", line 151, in applyFilters
    method()
  File "/usr/local/src/SABnzbd/sabnzbd/interface.py", line 232, in beforeFinalize
    cherrypy.response.body = rsrc.callable(rsrc.instance,
TypeError: api() got an unexpected keyword argument 'apikey'
sorry I could not reply sooner was at work and could not access the browser on my local network at home yesterday and last night had family come into town for the holiday so was away from the computer all night.
Last edited by Shadowtester on July 3rd, 2009, 8:44 am, edited 1 time in total.
User avatar
Shadowtester
Newbie
Newbie
Posts: 44
Joined: July 31st, 2008, 11:04 am

Re: SABnzbd stats script for XChat (linux)

Post by Shadowtester »

The new testing file worked great thank you
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

thx for reporting back! will be in the next release.
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

Download see first reply

0.61

* changed apikey handling, so versions < 0.4.9 are supported
fredlkrue
Newbie
Newbie
Posts: 30
Joined: June 14th, 2009, 5:00 pm

Re: SABnzbd stats script for XChat (linux)

Post by fredlkrue »

i get this output in xchat on the latest version: Current Speed: api?mode=qstatus&output=xml&apikey=(my key here) ....
another request, since you added the "remaining size of the current download", i want to change the color, so it should be best if it can be done in sab.tcl instead of getsabdata...

EDIT: forgot to mention that your package contains the backup files (~filename), please remove them. I know they are small but makes a smaller package :)
Last edited by fredlkrue on July 5th, 2009, 1:58 pm, edited 1 time in total.
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

fredlkrue wrote: i get this output in xchat on the latest version: Current Speed: api?mode=qstatus&output=xml&apikey=(my key here) ....
another request, since you added the "remaining size of the current download", i want to change the color, so it should be best if it can be done in sab.tcl instead of getsabdata...

EDIT: forgot to mention that your package contains the backup files (~filename), please remove them. I know they are small but makes a smaller package :)
sorry about that!

fixed now.

0.62

* fixed an error in the ouput of speed
* moved "Remaing:" in the silent nzb output from sabgetdata to the tcl
fredlkrue
Newbie
Newbie
Posts: 30
Joined: June 14th, 2009, 5:00 pm

Re: SABnzbd stats script for XChat (linux)

Post by fredlkrue »

Thanks for the fast reply/fix, so far is working great :)
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

simple Python recode:

- should work with win/linux xchat (if xchat < 2.0 extra python stuff is needed), windows needs python installed in a folder c:\python25 even if the python version is 2.6 or above, otherwise XChat will complain !!!
- less options (more to come with SABnzbd+ 0.5), but only one single file

- edit host, port, apikey, user and password in sab.py to your needs
- load from XChat or move to XChatdir to autoload on startup
- /sab spams current speed, queuesize and ETA
- /sabe same but simple print, so no spam

download

hf :)
fredlkrue
Newbie
Newbie
Posts: 30
Joined: June 14th, 2009, 5:00 pm

Re: SABnzbd stats script for XChat (linux)

Post by fredlkrue »

Nice, thanks a lot :)
lommes
Newbie
Newbie
Posts: 23
Joined: June 24th, 2009, 3:23 am

Re: SABnzbd stats script for XChat (linux)

Post by lommes »

small update

- fixed bug where same data was displayed all the time
- should work with trunk and 0.5 now

download
fredlkrue
Newbie
Newbie
Posts: 30
Joined: June 14th, 2009, 5:00 pm

Re: SABnzbd stats script for XChat (linux)

Post by fredlkrue »

Many thanks.
Post Reply