jonpetersathan Posted March 11, 2021 Share Posted March 11, 2021 (edited) Summary: Support Thread for Tenasi - PlexAnnouncer DockerHub: https://hub.docker.com/r/tenasi/plexannouncer Project: https://github.com/tenasi/plexannouncer Note: A Plex Pass is required to configure webhooks! What is PlexAnnouncer? PlexAnnouncer is a Discord bot that sends updates about newly added Plex media to a Discord channel of your choice using webhooks. Basically it proxies plex webhooks to discord. The bot itself is written in Python 3 and is using discord.py and aiohttp. Getting Started / Configuration 1. Create a Discord webhook and copy the webhook url. Goto Server Settings / Integration / Webhooks / Add Webhook. Setup a profile picture (e.g. this) and name and copy the Discord Webhook URL. 2. Install PlexAnnouncer from the Unraid CA store. Make sure that PlexAnnouncer is in the same Network as your Plex container. Paste the Discord Webhook URL and enter some random token for your Plex Webhook (can be any alphanumeric value). Last but not least you have to tell PlexAnnouncer your Plex server URL (so it can link to it). Your server URL should look like this: https://app.plex.tv/desktop#!/server/SERVERID You can copy it from your browsers address bar, if you click on any movie within your library. 3. Add a new webhook in Plex. Goto Plex / Settings / Webhooks / Add Webhook and enter the following url: http://IP:PORT/PLEX_WEBHOOK_TOKEN Replace IP with the address of your container or localhost in case you are running Plex and PlexAnnouncer on the same host. Replace PORT with your external port you mapped (default: 32500) and finally append your Plex Webhook token you specified earlier. Also make sure you have both Webhooks and Push Notifications enabled: Plex Server Settings / Network / Webhooks (Advanced View) Plex Server Settings / General / Push Notifications (Advanced View) 4. Whitelist libraries (Optional) If you wish to get updates only of specific libraries, add a new environment variable called UPDATED_LIBRARIES and specify the libraries (comma separated) you want to receive updates from. Note: If you configured PA based on the old guide, the config file is now deprecated, but still functional. However if you encounter any issues, try using env vars instead. About Us GitHub Profile: https://github.com/tenasi DockerHub Profile: https://hub.docker.com/u/tenasi If you like our work, please consider supporting it: https://paypal.me/tenasi Edited July 16, 2021 by JohnnyP 1 1 Quote Link to comment
Goldoni Posted March 12, 2021 Share Posted March 12, 2021 So when launching the app for the second time after you change the config file. Is it supposed to stay running or just not start at all?( When I launched it the first time it didn't stay running also btw) Quote Link to comment
jonpetersathan Posted March 12, 2021 Author Share Posted March 12, 2021 Yes, it is supposed to stay running, after you modified the config file accordingly. The first time you run it, it will create a basic config file and then error out since of the missing discord webhook credentials. Is there anything being displayed in the logs? (Right click container / Logs) Also make sure that your DISCORD_WEBHOOK_ID looks like 819835938443493436 and your DISCORD_WEBHOOK_TOKEN should look like pMCEZmx8HG9qeLzpDukzHOCnbLjtXf4YSCpIMGaEt4M2YOu7LrcdMhNnFF9CWsaXF7kf. 1 Quote Link to comment
Goldoni Posted March 12, 2021 Share Posted March 12, 2021 Log states this 3 times. (Edited for security). I have edited the config.json file in location /mnt/user/appdata/config.json and also edited the config in loaction /path/to/dir/ Also When starting the container the second time it creates a second docker with a weird name and that in the log says inbound request hundreds of times. Plex webhook URL: http://localhost:32500/VmjEZFihh08vZmadZfPEd8--etc--- Error reading configuration, please check your config file GNU nano 4.6 config.json { "plex_server_url": "https://app.plex.tv/desktop#!/server/_zyp2---etc---Xk", "plex_webhook_token": "VmjEZFihh08vZmadZfPEd8---etc---", "discord_webhook_id": "819788---etc---0248", "discord_webhook_token": "YHcWNmrcsx7WF---etc---4T1u-YuDo4nK3lvS5" } Quote Link to comment
roadkill Posted March 12, 2021 Share Posted March 12, 2021 (edited) So i have this set up but its sending nothing to discord. my plexannouncer is showin in the log that it gets something from plex but nothing happens in discord ======== Running on http://0.0.0.0:32500 ======== (Press CTRL+C to quit) Inbound request Inbound request Inbound request everything is set up exactly as in instructions Any ideas? Edited March 12, 2021 by roadkill spelling Quote Link to comment
jonpetersathan Posted March 12, 2021 Author Share Posted March 12, 2021 (edited) @Goldoni: Your config looks alright so far. The problem seems that the container is not able to find the config file. Make sure to change the "Config Path" to something like "/mnt/user/appdata/plex_announcer/" and then, after creating the container edit the file generated e.g. with "nano /mnt/user/appdata/plex_announcer/config.json" Edited March 12, 2021 by JohnnyP Quote Link to comment
jonpetersathan Posted March 12, 2021 Author Share Posted March 12, 2021 @roadkill 23 minutes ago, roadkill said: So i have this set up but its sending nothing to discord. my plexannouncer is showin in the log that it gets something from plex but nothing happens in discord ======== Running on http://0.0.0.0:32500 ======== (Press CTRL+C to quit) Inbound request Inbound request Inbound request everything is set up exactly as in instructions Any ideas? Plex sends constantly updates via the webhook, for example if you play/pause a movie. Make sure you add a new movie to plex. It must not be scanned by plex before, so removing one and adding it again does not work. If the movie appears in plex under "Recently Added" then plex will send a "library.new" event to PlexAnnouncer which then sends a Discord message (this may take a couple of seconds). Also note that currently only movies are supported (not tv shows or music tracks). Quote Link to comment
jamerperson Posted March 13, 2021 Share Posted March 13, 2021 I was having a bunch of issues. I was trying to modify the config file with notepad++ in windows. I kept getting errors and it looked like the config file wasn't always saving. Reading above, I noticed that you were using nano to edit the config file. Once I used nano to edit the config file, I got it to work. Instead of a config file, could I recommend that you just use docker variables? I'm not super familiar with linux, so it took me longer to figure out than I'd like to admit. I also don't know much about docker programming, so I don't know how easy that is. I got it running right now (although haven't had a new movie to add to my server yet). Thank you for this! Quote Link to comment
jonpetersathan Posted March 13, 2021 Author Share Posted March 13, 2021 5 hours ago, jamerperson said: I was having a bunch of issues. I was trying to modify the config file with notepad++ in windows. I kept getting errors and it looked like the config file wasn't always saving. Reading above, I noticed that you were using nano to edit the config file. Once I used nano to edit the config file, I got it to work. Instead of a config file, could I recommend that you just use docker variables? I'm not super familiar with linux, so it took me longer to figure out than I'd like to admit. I also don't know much about docker programming, so I don't know how easy that is. I got it running right now (although haven't had a new movie to add to my server yet). Thank you for this! Yeah, I didn't get env vars working at the first try and I prefer having all my config in appears to back them up easily, but since you all seem to have trouble with the config file, I should probably reconsider this. Shouldn't be to hard to implement. Thanks for the feedback anyway, really appreciate it! I will take a look at this over the weekend and give you guys an update. Quote Link to comment
LastXem Posted March 13, 2021 Share Posted March 13, 2021 Hey, thank you for your work. I have a problem, which is, my plex_announcer is listing on a different port than the one I set. i've added the port in my url and in my plex announcer settings in unraid. Quote Link to comment
jonpetersathan Posted March 14, 2021 Author Share Posted March 14, 2021 (edited) 20 hours ago, LastXem said: Hey, thank you for your work. I have a problem, which is, my plex_announcer is listing on a different port than the one I set. i've added the port in my url and in my plex announcer settings in unraid. If you changed the port in both the Plex Webhook URL and PA Settings, it should work. Note, that the port displayed as "Listen on ..." within the containers logs will always be 32500, since it refers to the local port of the container. The Docker daemon will "reroute" the port to whatever you specified in the settings tab. Nvm, just noticed Unraid is passing through the external port as environment variable, so I changed the log output, just update the container. Edited March 14, 2021 by JohnnyP Quote Link to comment
jonpetersathan Posted March 14, 2021 Author Share Posted March 14, 2021 Hey all, I've updated the container and guide above to work with environment variables now, so if you have any trouble try the following: 1. Stop and Remove the PlexAnnouncer container. 2. Delete the template file. (Run from terminal: rm /boot/config/plugins/dockerMan/templates-user/my-PlexAnnouncer.xml) 3. Install PlexAnnouncer and set it up accordingly. 4. Double check your are running the latest image, by clicking Docker / Check for Updates within Unraid. Quote Link to comment
raujaku Posted March 14, 2021 Share Posted March 14, 2021 Is there anyway to test it without having to add a new movie to our Plex libraries? Quote Link to comment
jonpetersathan Posted March 14, 2021 Author Share Posted March 14, 2021 2 minutes ago, raujaku said: Is there anyway to test it without having to add a new movie to our Plex libraries? Yes, open PA's log from the Unraid GUI and start playback of any plex movie. If the log is displaying something like "Inbound request... Ignoring event not of type library.new" then everything is working correctly. Quote Link to comment
Tergi Posted March 16, 2021 Share Posted March 16, 2021 Hello, I have the plex end of this configured and i get the inbound request messages. However when a new video does arrive in the server it does not go to discord. Also, when i copy the discord webhook url from discord channel and paste it into the template config the docker exits and the logs indicate: Invalid discord webhook url Falling back to manual discord webhook configuration discord_webhook_id is not defined I noticed that in your example the domain for discord is not the same as the one discord is using. I modified the domain to the same as your example and it was accepted and starts. I still do not get the notifications in discord however. The channel I'm using this in is a private invite only channel, but i don't think that should matter. I have other webhook bots that are able to post to restricted channels like this. Here is how the domain is in the webhook URL copied from my discord client i trimmed the important bits off the end: https://discordapp.com/api/webhooks/ Quote Link to comment
jonpetersathan Posted March 16, 2021 Author Share Posted March 16, 2021 8 hours ago, Tergi said: I noticed that in your example the domain for discord is not the same as the one discord is using. I modified the domain to the same as your example and it was accepted and starts. Should be fixed now, update your container to the latest version. 8 hours ago, Tergi said: I still do not get the notifications in discord however. Is there anything displayed in your logs, if you add a new movie? Be aware that it takes a couple of seconds before plex sends a library.new event to the webhook. If plex does so, you should see something like "Inbound requests... Handling new movie announcement..." in your logs. Quote Link to comment
Goldoni Posted March 17, 2021 Share Posted March 17, 2021 I have started from scratch and seems to get to the point of ====Running on http://0.0.0.0:32500====== and nothing ever post in discord and nor does the logs ever say 'Handling new movie announcement. I am used binhex-plexpass docker for plex. Could that be my problem maybe? Quote Link to comment
jonpetersathan Posted March 17, 2021 Author Share Posted March 17, 2021 @Goldoni Can you reach (ping) your PA container from within your Plex container? If not, what network adapter are you using? Bridge or Host? It doesn't matter if you are using binhex or the official Plex container. If you have the correct IP in your Plex Webhook URL and both containers are able to communicate, you should at least see "Inbound request" if you start playback of any movie. Quote Link to comment
Goldoni Posted March 19, 2021 Share Posted March 19, 2021 @JohnnyP root@Tower:~# telnet localhost 32500 Trying 127.0.0.1... Connected to localhost. root@Tower:~# telnet 192.168.1.60 32500 Trying 192.168.1.60... Connected to 192.168.1.60. Seems like I can ping it. PA seems to be set to bridge. Plex seems to be set to host. Also for the Plex webhook URL I set both localhost:32500 and 192.168.1.60:32500. ======== Running on http://0.0.0.0:32500 ======== (Press CTRL+C to quit) Inbound request Ignoring request, event type not of library.new Inbound request Ignoring request, event type not of library.new I receive this which makes me think that it is working correctly but even after added 4 different movies(which was not added ever before). Nothing I trying my hardest to try all different ways of getting this going and just beating my head against the wall. Thanks for all of the help. Quote Link to comment
jonpetersathan Posted March 19, 2021 Author Share Posted March 19, 2021 @Goldoni Can you check, if you have Webhooks enabled? Plex Server Settings / Network / Webhooks (Advanced View) If yes and it is still not working, maybe try enabled Push Notifications as well: Plex Server Settings / General / Push Notifications (Advanced View) Restart Plex afterwards. If that also doesn't work, hit me up with a PM and we will figure this one out Quote Link to comment
Goldoni Posted March 19, 2021 Share Posted March 19, 2021 @JohnnyP So Webhooks was enabled. but Push Notifications was not. I enabled it and will get back to you when I am able to add a new movie to see if it works. Thanks! Quote Link to comment
Goldoni Posted March 19, 2021 Share Posted March 19, 2021 7 hours ago, JohnnyP said: @Goldoni Can you check, if you have Webhooks enabled? Plex Server Settings / Network / Webhooks (Advanced View) If yes and it is still not working, maybe try enabled Push Notifications as well: Plex Server Settings / General / Push Notifications (Advanced View) Restart Plex afterwards. If that also doesn't work, hit me up with a PM and we will figure this one out Holy **** that did the trick!!! Quote Link to comment
jonpetersathan Posted March 19, 2021 Author Share Posted March 19, 2021 Glad to hear it worked! I should probably add it to the guide as well then. Quote Link to comment
wickedathletes Posted March 19, 2021 Share Posted March 19, 2021 im just gonna buck up and ask the embarrassing question... https://app.plex.tv/desktop#!/server/SERVERID How do I find this, cause I have NO IDEA lol. Quote Link to comment
jonpetersathan Posted March 19, 2021 Author Share Posted March 19, 2021 @wickedathletes Open any movie from your library in plex and look at the URL 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.