[PP-Script / Queue-Script] Notifications (All In One)

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
pacload
Posts: 2
Joined: 21 Mar 2015, 03:52

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by pacload » 22 Mar 2015, 16:29

Many Thanks l2g I'll give it a try later

kgoroway
Posts: 3
Joined: 30 Apr 2015, 17:33

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by kgoroway » 30 Apr 2015, 17:44

I'm a bit surprised there hasn't been a request to notify a tivo.

pyTivo will automatically push a file to a specified tivo if passed the correct command line (actually, I think it's a wget, but I'd have to go refresh my memory).

Only issue I see is that it will need the exact filename and that seems difficult to know if VideoSort is involved (it likely renamed the file, and moved it elsewhere...)

Sickbeard has tivo notification built in, and it seems to work fine.

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by l2g » 12 May 2015, 02:22

kgoroway wrote:I'm a bit surprised there hasn't been a request to notify a tivo.
I think you might be confused as to what this tool outputs and for that reason, there are several reasons why this script shouldn't do this. That said, there is no reason why someone couldn't make a new NZBGet-PPScript that does pyTivo calls. It's still a good idea!

This current script displays a full summary of all the files downloaded, they're sizes, statistics, logging errors (if any occurred, etc). A pyTivo wouldn't know what to do with this information.

A pyTivo uses containers (identified in a pytivo.conf file) which identifies a directory path and the type of data located there. They are usually configured with 'a lot' of containers each identifying different kinds of media (TVShows, Movies, Music, etc).

SickBeard pulls this off using a very basic approach that they can get away with because it 'explicitly' deals only with TV Shows. For this reason, you can get the user to identify the container they associated with 'just that' (TV Shows). NZBGet is much more broad and can support tons of categories and file types (mp3's, images, eBooks, Movies, etc will all come down). Here is Sickbeards commit that fixes everything to 1 container.

Your idea isn't bad though; it just needs a NZBGet PP Script of it's own. One where you can have a configuration allowing you to map NZBGet Categories to Containers and/or through regular expressions looking at the file types. This would help identify some of the (pyTivo) container's file paths so the API notification can be built correctly and it would be very easy then to notify the server.

Personally, I don't use a tivo, so i wouldn't have any way of testing any code i could write; therefore I can't help you out. But maybe some ambitious coder reading this post will! :) The commit link I provided pretty much sets up the basics with the exception of they dynamic container support.

kgoroway
Posts: 3
Joined: 30 Apr 2015, 17:33

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by kgoroway » 12 May 2015, 13:17

Thanks. You are right that I misunderstood the output of this plugin. I confused sickbeard's "notification" with the description of this plugin.

I think the tivo crowd uses the concept of "auto-push" which just watches a parent folder and pushes any new content to the tivo. That could be why they isn't more interest in a specific push script.

Thanks again for your response.

p00chie
Posts: 2
Joined: 15 Jun 2015, 19:08

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by p00chie » 15 Jun 2015, 19:11

Notifications to Notify my Android won't work.
I had to edit NotifyMyAndroid.py --> NMA_URL = 'https://www.notifymyandroid.com/publicapi/notify'

I can see in the log files:
Mon Jun 15 19:06:01 2015 INFO Notify: [DEBUG] get(config) ONQUEUE="yes"
Mon Jun 15 19:06:01 2015 INFO Notify: [DEBUG] get(config) SERVERS="nma://apikey"
Mon Jun 15 19:06:01 2015 INFO Notify: [DEBUG] get(config) INCLUDEIMAGE="yes"
Mon Jun 15 19:06:01 2015 INFO Notify: [DEBUG] Server parsed to: {'host': 'apikey', 'user': None, 'query': None, 'url': 'nma://apikey', 'path': None, 'fullpath': None, 'password': None, 'port': None, 'schema': 'nma'}
Mon Jun 15 19:06:01 2015 INFO Notify: [DEBUG] NMA POST URL: https://www.notifymyandroid.com/publicapi/notify
Mon Jun 15 19:06:01 2015 INFO Notify: [DEBUG] NMA Payload: {'priority': 0, 'application': 'NZBGet-Notify', 'apikey': 'apikey', 'event': 'New File Queued for Download', 'description': 'Message'}

Mon Jun 15 19:06:03 2015 INFO Notify: Sent NMA notification.

But i did not receive the message on nma :(

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by l2g » 17 Jun 2015, 02:00

p00chie wrote:Notifications to Notify my Android won't work.
I had to edit NotifyMyAndroid.py --> NMA_URL = 'https://www.notifymyandroid.com/publicapi/notify'
...
Mon Jun 15 19:06:03 2015 INFO Notify: Sent NMA notification.

But i did not receive the message on nma :(
Thanks for testing this for me; I guess you're the first one to use the NMA part of this tool. I fixed the URL in the master branch of GitHub as well as figured out the other reason why it wasn't working. BTW, thanks for your help in finding a good portion of the problem in your previous post! I went ahead and closed the ticket you created based on this commit.

Please test it out using the master branch and let me know how it goes!

p00chie
Posts: 2
Joined: 15 Jun 2015, 19:08

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by p00chie » 18 Jun 2015, 14:23

Thank you very much. Not it is working fine :)

rambutan46
Posts: 4
Joined: 19 Jun 2015, 10:29

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by rambutan46 » 19 Jun 2015, 10:39

Hi,

I'm trying to make this work on a Synology with DSM5.2 installed but it fails with the following error:

Code: Select all

python Notify.py -s prowl://my-secret-sauce-key -t "Test" -b "This is not a test" 
2015-06-19 12:27:51,813 - 13584 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "Notify/nzbget/ScriptBase.py", line 2274, in run
    exit_code = main_function(*args, **kwargs)
    File "Notify.py", line 648, in main
    notify_type=notify_type,
    File "Notify.py", line 443, in notify
    nobj.notify(body=body, title=title, notify_type=notify_type)
    File "Notify/pnotify/NotifyBase.py", line 267, in notify
    **kwargs):
    File "Notify/pnotify/NotifyProwl.py", line 122, in _notify
    'application': self.api_id,
  AttributeError: 'NotifyProwl' object has no attribute 'api_id'
The logs in NZBGet display the following:

Code: Select all

ERROR	Fri Jun 19 2015 12:13:14	Post-process-script Notify.py for SuperLegalBackupDownload failed
ERROR	Fri Jun 19 2015 12:13:14	Notify: AttributeError: 'NotifyProwl' object has no attribute 'api_id'
INFO	Fri Jun 19 2015 12:13:14	Notify: 'application': self.api_id,
ERROR	Fri Jun 19 2015 12:13:14	Notify: File "/usr/local/nzbget/share/nzbget/scripts/Notify/pnotify/NotifyProwl.py", line 122, in _notify
INFO	Fri Jun 19 2015 12:13:14	Notify: **kwargs):
ERROR	Fri Jun 19 2015 12:13:14	Notify: File "/usr/local/nzbget/share/nzbget/scripts/Notify/pnotify/NotifyBase.py", line 267, in notify
INFO	Fri Jun 19 2015 12:13:14	Notify: nobj.notify(body=body, title=title, notify_type=notify_type)
ERROR	Fri Jun 19 2015 12:13:14	Notify: File "/usr/local/nzbget/share/nzbget/scripts/Notify.py", line 443, in notify
INFO	Fri Jun 19 2015 12:13:14	Notify: notify_type=notify_type,
ERROR	Fri Jun 19 2015 12:13:14	Notify: File "/usr/local/nzbget/share/nzbget/scripts/Notify.py", line 626, in postprocess_main
INFO	Fri Jun 19 2015 12:13:14	Notify: exit_code = main_function(*args, **kwargs)
ERROR	Fri Jun 19 2015 12:13:14	Notify: File "/usr/local/nzbget/share/nzbget/scripts/Notify/nzbget/ScriptBase.py", line 2274, in run
ERROR	Fri Jun 19 2015 12:13:14	Notify: Traceback (most recent call last):
DSM is using Python2.7.10-14

Any help would be appreciated!

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by l2g » 19 Jun 2015, 21:03

@rambutan46: Try now; it's nice to see some activity on all the different notification services i don't use (and have not tested). Thus, I appreciate you reporting this!

When you download the update to TidyIt, make sure you use the master branch for now as I have not created an official release yet. The commit that (should have) fixed it is here.

rambutan46
Posts: 4
Joined: 19 Jun 2015, 10:29

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by rambutan46 » 22 Jun 2015, 10:42

Thanks l2g, there's improvement but it still fails:

Code: Select all

python /usr/local/nzbget/share/nzbget/scripts/Notify.py -s prowl://6e<secretsauce>a0 -t "Test" -b "This is not a test"
2015-06-22 12:35:33,248 - 14842 - WARNING - Failed to send Prowl notification: Verification Failed. (error=401).
I've generated a new API but that didn't help.
Owner/group and permission are set correctly:

Code: Select all

drwxr-xr-x   14 nzbget   root          4096 Jun 22 12:34 Notify
-rwxr-xr-x    1 nzbget   root         24917 Jun 19 22:58 Notify.py
enjoy,
r.

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests