[SUPPORT] Tenasi - PlexAnnouncer


Recommended Posts

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.

 

1081302398_Screenshot2021-03-12004711.png.9c4b59e5151607d8730eec2a7203ac70.png

 

 

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.

image.png.f53a1641729738be45d463ce8bb30705.png

 

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.

image.thumb.png.3e5bdd89fe47bfebd0f089d25a448070.png

 

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 by JohnnyP
  • Thanks 1
Link to comment

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.

Link to comment

 

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"
}

Link to comment

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 by roadkill
spelling
Link to comment
Posted (edited)

@GoldoniYour 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"

 

544832117_Screenshot2021-03-12233603.thumb.png.622b779f22d6e86fcefd78083f28a58e.png

Edited by JohnnyP
Link to comment

@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).

Link to comment

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!

Link to comment
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.

Link to comment
Posted (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 by JohnnyP
Link to comment

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.

Link to comment
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.

Link to comment

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/

Link to comment
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.

Link to comment

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?

Link to comment

@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.

 

 

 

Link to comment

@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.

Link to comment

@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 :)

Link to comment
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!!!

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.