nwithan8 / tauticord

A Discord bot that displays live data from Tautulli
GNU General Public License v3.0
102 stars 22 forks source link

[FEATURE] - Use Plex API to gather system stats #223

Open identd113 opened 5 days ago

identd113 commented 5 days ago

This request has not already been submitted

The feature is appropriate for Tauticord

Feature Type / Category

Integration (e.g. New service integration)

Feature Details

Currently , tauticord provides stats (CPU/memory) of the device running the tauticord instance, which may not be the same as the device running Plex. This information may be available, via https://python-plexapi.readthedocs.io/en/latest/modules/server.html#plexapi.server.StatisticsResources This would allow tauticord to provide a more realistic view of the Plex Server environment

nwithan8 commented 5 days ago

I've done some preliminary research on this when it was requested a few weeks ago. The Plex API does offer up the information, so that shouldn't be a problem. The main concern is how to establish a Plex API connection via Tautulli, since the only configuration that Tauticord takes is details to connect to Tautulli. As far as I know currently, Tautulli will not reveal its Plex token to allow us to proxy to Plex. I also don't want to add Plex configuration to the bot directly, because that opens a whole can of worms of "what data comes from Tautulli versus what data comes directly from Plex".

I'll continue looking. If I do find a way to proxy to Plex via Tautulli, I'll probably have to add that to the underlying API library first.

nwithan8 commented 23 hours ago

I've done some preliminary research on this when it was requested a few weeks ago. The Plex API does offer up the information, so that shouldn't be a problem. The main concern is how to establish a Plex API connection via Tautulli, since the only configuration that Tauticord takes is details to connect to Tautulli. As far as I know currently, Tautulli will not reveal its Plex token to allow us to proxy to Plex. I also don't want to add Plex configuration to the bot directly, because that opens a whole can of worms of "what data comes from Tautulli versus what data comes directly from Plex".

I'll continue looking. If I do find a way to proxy to Plex via Tautulli, I'll probably have to add that to the underlying API library first.

UPDATE: Yes, it will be possible, as the Plex token used in Tautulli can be retrieved programmatically via Tautulli's API. The underlying Tautulli API library is being updated to add support: https://github.com/nwithan8/pytulli/pull/48