Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Use Discord RPC to display local Plex session data.

License

Notifications You must be signed in to change notification settings

barrettotte/Plex-Discord-RPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plex-Discord-RPC

docs/watching.png

Use Discord RPC to display local Plex session data.

Background

I made this for me; it is really only handling my single use case (Linux environment and a Plex server on local network).

By all means, if someone wants to make this more generic I think they easily could. But, that's not in the scope for this little side project.

The only goal is to watch a show on Plex and have it update my Discord activity.

docs/status.png

Approach

I just wanted to do something pretty straightforward, so here it is.

  • Hit Plex Web API for list of active sessions on server
  • Grab local IP and compare to session IP
  • Gather session data for current media
  • Update Discord activity/status via Discord RPC with media data
  • Provide link to Anilist entry if session is watching entry from library 'Anime'

docs/anilist.png

Dev Setup

Run on Startup - Linux + PM2

  • install dependencies sudo npm i pm2@latest -g
  • setup app pm2 start src/plex_discord_rpc.js
  • save app process pm2 save
  • enable pm2 to start on boot pm2 startup
  • view status pm2 list

Run on Startup - Lazy Windows Setup

  • There are way better methods to do this, but I'm feeling particularly lazy today; I barely get on Windows anymore.
  • Edit setup/Plex_Discord_RPC.bat to match current path of repository
  • Create shortcut pointing to setup/Plex_Discord_RPC.bat
  • Copy shortcut to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
  • If the script fails its not going to start back up. That's another problem for another day.

References