[PP-Script] NotifyPlex - Library Update and GUI Notification

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.
joq3
Posts: 13
Joined: 01 Mar 2015, 20:09

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by joq3 » 16 Mar 2015, 11:42

hugbug wrote:Line endings changed to windows format. Change them back to unix format (LF).
Now it is running, but I get this "error":

"NotifyPlex: This script is supposed to be called from NZBGet v13.0 or later.
NotifyPlex: *** NZBGet scheduler script ***
Executing scheduler-script NotifyPlex.py for Task2"

I am using NZBGet 14.0

joq3
Posts: 13
Joined: 01 Mar 2015, 20:09

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by joq3 » 18 Mar 2015, 11:59

Can anyone help me? I might have broken the script when I changed it to SCHEDULED instead of POST-PROCESS.
If the creator could add this option (to use scheduled) I would be very thankful!

minimeh
Posts: 33
Joined: 16 Aug 2013, 09:54

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by minimeh » 18 Mar 2015, 19:52

There is a "sanity check" in notifyplex.py:

Code: Select all

if not 'NZBPP_STATUS' in os.environ:
        print('*** NZBGet post-processing script ***')
        print('This script is supposed to be called from NZBGet v13.0 or later.')
        sys.exit(POSTPROCESS_ERROR)
This check is valid only for post processing scripts (NZBPP_STATUS is post process status). You can try commenting it out (insert # in front of the lines above) and cross your fingers that other dependencies on post processing resources don't exist. The sanity check itself does nothing more than try to verify that the script is being executed from an appropriate version of nzbget and is otherwise non-functional.

[EDIT]
A quick check shows that NZBPP_STATUS is used again a few lines lower:

Code: Select all

#Check to see if download was successful
ppStatus=os.environ['NZBPP_STATUS']=='SUCCESS/ALL'
Try changing that to:

Code: Select all

#Check to see if download was successful
#ppStatus=os.environ['NZBPP_STATUS']=='SUCCESS/ALL'
ppStatus=True

mannibis
Posts: 60
Joined: 29 Jul 2014, 15:10

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by mannibis » 18 Mar 2015, 23:00

Thanks minimeh :) Just got around to checking the thread but saw you already offered help. If there are any issues, OP, let me know.

joq3
Posts: 13
Joined: 01 Mar 2015, 20:09

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by joq3 » 19 Mar 2015, 12:53

minimeh wrote:There is a "sanity check" in notifyplex.py:

Code: Select all

if not 'NZBPP_STATUS' in os.environ:
        print('*** NZBGet post-processing script ***')
        print('This script is supposed to be called from NZBGet v13.0 or later.')
        sys.exit(POSTPROCESS_ERROR)
This check is valid only for post processing scripts (NZBPP_STATUS is post process status). You can try commenting it out (insert # in front of the lines above) and cross your fingers that other dependencies on post processing resources don't exist. The sanity check itself does nothing more than try to verify that the script is being executed from an appropriate version of nzbget and is otherwise non-functional.

[EDIT]
A quick check shows that NZBPP_STATUS is used again a few lines lower:

Code: Select all

#Check to see if download was successful
ppStatus=os.environ['NZBPP_STATUS']=='SUCCESS/ALL'
Try changing that to:

Code: Select all

#Check to see if download was successful
#ppStatus=os.environ['NZBPP_STATUS']=='SUCCESS/ALL'
ppStatus=True
Did this, and this is the output:

Code: Select all

INFO	Thu Mar 19 2015 13:50:00	NotifyPlex: KeyError: 'NZBPP_NZBNAME'
INFO	Thu Mar 19 2015 13:50:00	NotifyPlex: raise KeyError(key)
INFO	Thu Mar 19 2015 13:50:00	NotifyPlex: File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
INFO	Thu Mar 19 2015 13:50:00	NotifyPlex: nzbName=os.environ['NZBPP_NZBNAME']
INFO	Thu Mar 19 2015 13:50:00	NotifyPlex: File "/usr/share/nzbget/scripts/NotifyPlex.py", line 125, in <module>
INFO	Thu Mar 19 2015 13:50:00	NotifyPlex: Traceback (most recent call last):
INFO	Thu Mar 19 2015 13:50:00	Executing scheduler-script NotifyPlex.py for Task2
INFO	Thu Mar 19 2015 13:45:28	nzbget 14.0 daemon-mode
mannibis wrote:Thanks minimeh :) Just got around to checking the thread but saw you already offered help. If there are any issues, OP, let me know.
I think this got abit out of my league, if you can add this option to the script I would be grateful!

Thank you!

mannibis
Posts: 60
Joined: 29 Jul 2014, 15:10

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by mannibis » 19 Mar 2015, 12:58

Yea there is also a dependency on the NZB name for the GUI notification. I'll see what I can do.

joq3
Posts: 13
Joined: 01 Mar 2015, 20:09

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by joq3 » 22 Mar 2015, 16:02

mannibis wrote:Yea there is also a dependency on the NZB name for the GUI notification. I'll see what I can do.
Any progress? Thank you!

joq3
Posts: 13
Joined: 01 Mar 2015, 20:09

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by joq3 » 26 Mar 2015, 09:13

mannibis wrote:Yea there is also a dependency on the NZB name for the GUI notification. I'll see what I can do.
Is this something I can edit myself?
Thank you!

mannibis
Posts: 60
Joined: 29 Jul 2014, 15:10

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by mannibis » 26 Mar 2015, 20:51

Hey ! Sorry bud, I've been going crazy planning my wedding soon and I haven't had much free time. You would basically need to edit the .py to remove every instance of an nzb-specific post-proc environmental variable, which includes NZBPP_NZBNAME and the NZBPR variables. you can play around and just put # in front of problem areas when u get errors.

For me to do this right, I would need a good few hrs to test, as making this a Scheduler script would require me to strip alot of the features such as GUI notification and other stuff that is meant to run directly after the nzb file is finished.

joq3
Posts: 13
Joined: 01 Mar 2015, 20:09

Re: [PP-Script] NotifyPlex - Library Update and GUI Notifica

Post by joq3 » 27 Mar 2015, 12:51

mannibis wrote:Hey ! Sorry bud, I've been going crazy planning my wedding soon and I haven't had much free time. You would basically need to edit the .py to remove every instance of an nzb-specific post-proc environmental variable, which includes NZBPP_NZBNAME and the NZBPR variables. you can play around and just put # in front of problem areas when u get errors.

For me to do this right, I would need a good few hrs to test, as making this a Scheduler script would require me to strip alot of the features such as GUI notification and other stuff that is meant to run directly after the nzb file is finished.
No problem at all, you have your priorities right ;)
I tried doing this, put a # infront of thing that gave me error.
Finally I got this:
INFO Fri Mar 27 2015 13:30:01 NotifyPlex: NOTIFYPLEX: Targeted PLEX Update for Section Complete
INFO Fri Mar 27 2015 13:30:01 NotifyPlex: NOTIFYPLEX: Plex.tv Authentication Successful
INFO Fri Mar 27 2015 13:30:00 Executing scheduler-script NotifyPlex.py for Task2

But I went to Plex to check if it had refreshed everything it hasn't. Subliminal had downloaded a subtitle to a show that was added to the folder after the show itself (that way Plex showed it as no subtitles), but even after NotifyPlex did the refresh it didn't work. Still can't find the subtitle.
If I manually refresh this episode it shows up.

Something is wrong!

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests