Page 1 of 1

Notifications for paused/resumed items

Posted: January 22nd, 2023, 11:35 am
by FlangeMonkey
Hey,

I've been playing with the notifications to integrate into a Node-RED flow via a webhook and am needing paused/resumed actions for items. Am I correct is saying the notifications aren't programmed for these events?

Thanks,

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 12:56 pm
by sander
Via config/notify I see below ... so also Pause Resume


Startup / Shutdown
Pause / Resume
Added NZB
Post-processing started
Job finished
Job failed
Warning
Error
Disk full
Queue finished
User logged in
Other Messages

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 1:53 pm
by FlangeMonkey
Under testing that option is global pause and resume only, not the individual items/jobs.

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 2:00 pm
by sander
Ah, yes, correct.

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 2:12 pm
by FlangeMonkey
The only other option I can think of is using websocket, but from my research its not available?

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 2:40 pm
by sander
I don't know about websocket, but if you're a programmer, you can get info from the SABnzbd API:

For example: two downloads in the queue, one is Paused, one is Downloading:

Code: Select all

$ curl -s 'http://127.0.0.1:8080/api?output=json&apikey=f69d7cdb668f4628b4238ff61af0acc8&mode=queue' | python3 -m json.tool | grep -e nzo_id -e status -e filename
        "status": "Downloading",
                "nzo_id": "SABnzbd_nzo_rj4enauh",
                "filename": "My first download",
                "status": "Paused",
                "nzo_id": "SABnzbd_nzo_jyeb6yvj",
                "filename": "My other download",
                "status": "Downloading",
See https://sabnzbd.org/wiki/configuration/3.7/api for full details.

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 3:33 pm
by FlangeMonkey
Thanks for the suggestion, but I do something summary already. I'm looking for a real time output or webhook post, rather than a request. I can loop the request but that's not ideal.

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 3:41 pm
by sander
If you check sabnzbd.log, you can see this:

Code: Select all

$ cat .sabnzbd/logs/sabnzbd.log | grep -i -e "paused nzo" -e "resumed nzo"
2023-01-22 20:28:43,388::INFO::[nzbqueue:468] Paused nzo: SABnzbd_nzo_rj4enauh
2023-01-22 20:29:27,267::INFO::[nzbqueue:485] Resumed nzo: SABnzbd_nzo_rj4enauh
2023-01-22 20:29:32,502::INFO::[nzbqueue:468] Paused nzo: SABnzbd_nzo_rj4enauh

If you need it real-time, you can put it into the SABnzbd source code:

https://github.com/sabnzbd/sabnzbd/blob ... ue.py#L468

https://github.com/sabnzbd/sabnzbd/blob ... ue.py#L485

Re: Notifications for paused/resumed items

Posted: January 22nd, 2023, 4:53 pm
by FlangeMonkey
:) your a mind reader, I was just looking through the source. Thanks for the pointers, its very helpful.

Re: Notifications for paused/resumed items

Posted: January 23rd, 2023, 4:19 pm
by safihre
Indeed so far it's never been needed to hook into that action, so we never build it.