I made a Plex email notifier for Windows to let people know what's new in your libraries!
I wrote a Powershell script to report on movies recently added to your Plex library. It uses the Plex API as well as OMDBapi.com (the Open Movie Database) to fetch information on each movie. Powershell is Windows functionality, so this will only work on Windows unfortunately. I have it set up on my server as a Scheduled Task that runs every Friday at 10am, and sends the email to a Google Group I set up to include all the people I share my library with. See notes below for more info.
This should be relatively easy to set up for someone running their Plex Server on a Windows machine, but if you've never used Powershell before, here's what you need to do:
- Download PlexCheck.ps1 to your computer from here.
- Download Get-CredentialFromWindowsCredentialManager.ps1 from Tobias Burger
- Change the .ps1 extension on Get-CredentialFromWindowsCredentialManager.ps1 to .psm1, and save it to C:\Users[username]\Documents\WindowsPowershell\Modules\Get-CredentialFromWindowsCredentialManager.
Open a Powershell prompt and run the command
Store the credentials of the email address you want to send the email from in Windows Credential Manager. Instructions here. You should store them with the name "PlexCheck" to avoid having to specify a credential name when running the script.
- Run the script! You can run from a Powershell prompt, or by right-clicking and selecting Run.
This currently only allows one recipient. To avoid having to modify the script or Scheduled Task all the time, I set up a Google Group, added my friends to that, and set that as the lone recipient in my Scheduled Task.
This will run the script with default values:
- It will assume you're running it from the same box that your Media Server is running on. As such, the default IP is 127.0.0.1.
- It uses the default Plex port, 32400.
- The sender email address will be what's defined in your credentials in Windows Credential Manager.
- The to address, unless otherwise specified, will be the same as the sender address. Change it at run-time.
- This defaults to Gmail's SMTP server settings, but that can be overridden with parameters. To send from a Gmail account, "Access for less secure apps" must be turned on. Instructions here.
- This will send over SSL, and this can't be overridden. Just do it.
- This defaults to a 7-day lookback period, but that can be changed, if that's what you're into.
Here's an example of how to run it with all the values changed:
.\PlexCheck.ps1 -cred foo -url 10.0.0.100 -port 12345 -days 14 -emailTo 'firstname.lastname@example.org' -smtpServer 'smtp.server.com' -smtpPort 132
This is the first time I've publicly shared a script I wrote, so please let me know if you have any questions, comments, or suggestions!