Page 1 of 1

[PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 23 Sep 2019, 22:50
by fleXible
Introduction:
A NZBGet Post-processing script to notify your Plex Server to update/refresh a library upon finished downloads.

This let's you deactivate Scan my library automatically, Scan my library periodically and the broken Run a partial scan when changes are detected in Plex. This brings you a long way to support your HDD suspend feature when installed on a NAS. But you will still have to find a way to manage the logfiles.

Reason:
The original author seem to have been inactive since late 2017 and lately I found myself in the situation with the need to download it again, but couldn't find a working source.

NotifyPlex Script Details
Download: Releases and Readme
Source: GitHub
Original: [PP-Script] NotifyPlex - Library Update and GUI Notification

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 27 Sep 2019, 02:28
by geewhiz
Thanks for fixing the script, but I'm getting the following error when the script runs:

NotifyPlex: requests.exceptions.InvalidURL: Invalid URL u'http://:3005/jsonrpc': No host supplied

I've entered the correct Plex URL in the plexIP field. Any idea what's going on? Thanks.

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 27 Sep 2019, 09:50
by fleXible
I just check with my installation, there it's working correctly. Pls check your plexIP setting again. I entered IP:Port there

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 28 Sep 2019, 18:07
by geewhiz
Thanks. Figured it out. It was the clientsIP that was missing and I had guiShow enabled. I disabled guiShow and all is well.

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 01 Oct 2019, 21:15
by fleXible
Glad to hear, everything is fine. Enjoy!

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 25 Oct 2019, 16:57
by mannibis
Hey fleXible,

So I was bored these past few days and decided to update the script. I cleaned up a bunch of the code and made it more python "compliant", and more efficient with the XML parsing. I've also fixed some code formatting that was bugging me. I am also now using the requests module in this version 2.5, which is faster and more efficient than the old urllib2 module. There are no configuration changes whatsoever with regards to the options set in the NZBGet Web UI--it is simply a backend code update. You can simply replace NotifyPlex.py in your NZBGet scripts folder (and make sure it has execute priveleges AKA chmod +x) and that is all.

Here is a DropBox link to the updated v2.5 script: https://www.dropbox.com/s/ar5nf9kko66xx ... ex.py?dl=0

Thanks for taking up a support role with this script and I'm glad to see people are still finding it useful (I still use it as well). If you have any questions or concerns or want me to add/remove/update something let me know!

EDIT: I took a look at the script on GitHub and edited my updated version to reflect a minor change I noticed you made on line 109. Let me know if there is anything else I should edit or update. It's been quite a while and I can't remember if everything was working the way it was or not. I've tested my latest version and it works for me, so let me know!

-mannibis

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 04 Nov 2019, 23:48
by fleXible
Hi manabis,

it took me a while to go through your code and take in the changes. I've created a pull-request on github, so you can check and comment. I didn't take all the changes proposed, because I wanted to stay close to the NZBGet community especially regarding message output.

I don't really get, why the jump to version 2.5, so I changed it into my versioning scheme.

To be honest, I had quite a hard time to implement your changes, as they were quite a lot and from a different code base as it seems. That's one of the reasons I set-up the github repository, so there is a common ground and method for discussing and introducing changes to the code-base.

But still, thanks for your work and welcome back!

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 06 Nov 2019, 01:26
by geewhiz
Thanks to both of your for your work on this. I use this script every day so I appreciate you keeping it updated.

With python 2 support sun setting in 2020, does this script support python 3 yet? Thanks.

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 06 Nov 2019, 23:45
by fleXible
Good call! I heard it and just finished testing and making the needed changes.
I've updated the Pull-Request to let it sink in for a couple of days.

Re: [PP-Script] NotifyPlex - Library Update and GUI Notification (now on GitHub)

Posted: 19 Nov 2019, 09:11
by deoneR
hi i just installed it but getting this error:
Tue Nov 19 2019 10:04:25 NotifyPlex: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='my.plexapp.com', port=443): Max retries exceeded with url: /users/sign_in.xml (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0000000003D38D48>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: raise ConnectionError(e, request=request)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Python27\lib\site-packages\requests\adapters.py", line 516, in send
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: r = adapter.send(request, **kwargs)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Python27\lib\site-packages\requests\sessions.py", line 646, in send
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: resp = self.send(prep, **send_kwargs)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Python27\lib\site-packages\requests\sessions.py", line 533, in request
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: return session.request(method=method, url=url, **kwargs)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Python27\lib\site-packages\requests\api.py", line 60, in request
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: return request('post', url, data=data, json=json, **kwargs)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Python27\lib\site-packages\requests\api.py", line 116, in post
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: auth = requests.post(urlAuth, headers=headers, auth=HTTPBasicAuth(plexUser, plexPass))
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Program Files\NZBGet\scripts\NotifyPlex.py", line 149, in getAuthToken
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: 'X-Plex-Token': getAuthToken(plexUsername, plexPassword)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Program Files\NZBGet\scripts\NotifyPlex.py", line 181, in refreshAuto
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: refreshAuto(mCats, tCats, plexIP)
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: File "C:\Program Files\NZBGet\scripts\NotifyPlex.py", line 305, in <module>
INFO Tue Nov 19 2019 10:04:25 NotifyPlex: Traceback (most recent call last):
any ideas what am i doing wrong?