discord-rich-presence-plex: Connected to Plex, Not showing in Discord
I have installed plexapi, websocket-client==0.48.0, and and set my configuration in the file properly, it’s connected to the server and listening for specific username which it finds, and I have activity status turned on in my profile settings. However nothing is appearing in my profile as a watching/playing status. I’m a bit at a loss and not sure what else to do here.
Output
[05:39:56 PM] [Plex N Chill/06ae7] Logged in as Plex User "Plex.N.Chill"
[05:40:27 PM] [Plex N Chill/06ae7] Connected to Plex Media Server "Plex N Chill"
[05:40:27 PM] [Plex N Chill/06ae7] Listening for PlaySessionStateNotification alerts from user "zak"
[05:51:49 PM] [Plex N Chill/06ae7] <Episode:630835:We-Own-This-City-s01e01>, Session Key: 543, Users: ["Zak"]
[05:51:49 PM] [Plex N Chill/06ae7] Session found
[05:51:49 PM] [Plex N Chill/06ae7] Username "zak" matches "zak", continuing
[05:51:49 PM] [Plex N Chill/06ae7] Opening Discord IPC Pipe
[05:51:49 PM] [Plex N Chill/06ae7] [HANDSHAKE] _UnixSelectorEventLoop.create_unix_connection() got an unexpected keyword argument 'loop'
[05:51:49 PM] [Plex N Chill/06ae7] Closing Discord IPC Pipe
[05:51:49 PM] [Plex N Chill/06ae7] Received Update: {"sessionKey": "541", "clientIdentifier": "396bbacfe499509-com-plexapp-android", "guid": "plex://movie/5d776841961905001eb965e3", "ratingKey": "566460", "url": "", "key": "/library/metadata/566460", "viewOffset": 718323, "playQueueItemID": 156249, "playQueueID": 6550, "state": "playing"}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 46 (12 by maintainers)
Append
?size=512to grab a size that meets the minimum recommended size for Rich Presence assets.@zluckytraveler I have implemented the ability to display posters vide commit https://github.com/phineas05/discord-rich-presence-plex/commit/a40dbb45e8391b8b0b1c849e7610b81eded58414.
Refer to the README for instructions on obtaining an Imgur client ID and add the client ID to your
config.jsonas per the specified format.Also, the Discord client/application ID in the code has been moved here.
It basically means restructuring the code. The project consisted of a 400-line single file earlier which is messy and hard to read and maintain. In the process of refactoring it, I’ve split that file up into multiple ones, fixed some code smell and removed unneeded code.
There hasn’t been any major functionality changes ever since the first iteration of the script, plus I originally created this mainly for personal use not expecting it to grain traction, so I didn’t think multiple releases, changelogs or meaningful commit messages were required. For the recent changes, the commit messages can somewhat act as a changelog and you can always browse the repository as it was at an earlier commit to obtain older releases.
That project depends on pypresence to communicate with Discord so the code from that library might be causing the issue.
I was looking into this earlier and got started by figuring out fetching poster URLs from Plex. It wasn’t possible when I checked a few years ago because the images that could be displayed in Rich Presence were restricted to the assets uploaded under your application on the Discord Developer Portal but passing the URL to an image instead of an asset key seems to work now. Will try to implement it in the near future.
@zluckytraveler Thank you for testing and for the suggestions.
This should be fixed by the changes made in the latest commit.
I plan on refining the output more and adding back the colours. The old code with the colours was messy so I just removed it for now during the refactor.
I’ll be adding console commands which allow users to edit the config instead of having to edit the JSON file directly, which should hopefully help.
You can change the client/application ID here. Note that along with the “logo” asset, three more assets currently exist and are used as small icons for the different media states: “playing”, “paused”, and “buffering”.
playing: https://cdn.discordapp.com/app-assets/413407336082833418/413414267618852866.pngpaused: https://cdn.discordapp.com/app-assets/413407336082833418/413414293112094730.pngbuffering: https://cdn.discordapp.com/app-assets/413407336082833418/413414325248589836.pngI’m in the process of refactoring the project. I tried this a while back and it doesn’t seem to work.
Refer to this page where it says the following: