Chris Murton

Chris Murton

Radio Presenter & Technical Tinkerer

PlexPy - for the curious

Exciting data geekiness comes to your Plex Media Server

3-Minute Read

Well before Netflix, Amazon Prime Video et al. were a thing, I’ve been running Plex Media Server at home to ship media of all types (photos, music, TV shows and movies) to various devices around the house. I got so fed up with physical DVDs chewing up space in the lounge I went through and ripped every DVD we own to digital and subsequently cleared out two drawers worth of plastic and shiny discs - so I’m fairly invested. I have the lifetime Plex Pass to go with it too.

That all said and done, I guess my background in monitoring systems and analytics made me curious about how much my other half/daughter/I were watching particular films or listening to tunes and Plex doesn’t really offer much information out of the box in a easy to consume format.

Step forward PlexPy…

PlexPy is an awesome Python web application that sits in the background running a webserver and consuming all of your Plex Media Server’s logs and making something useful out of them.

After downloading, installing and running it for a few days you’ll get to know some high-level interesting facts about your Plex install right off the bat, like:

  • Most Watched Movie
  • Most Watched TV
  • Most Listened to Artist
  • Most Active User
  • Most Concurrent Streams

If you really like detail, it’ll also show you graphs about whether it’s being played using Direct Play, Direct Stream or Transcode. If you wanted to know whether 4k, 1080p, 720p or 576p resolution items are ticking your user’s boxes then it’ll give you that too.

Getting PlexPy

Linux

  • First you’ll need to ensure Python 2.7 is installed. On Ubuntu, this is as easy as running apt-get install python2.7.
  • Pull down the current master branch of the PlexPy project from GitHub: git clone https://github.com/JonnyWong16/plexpy.git
  • Change into the ‘plexpy’ directory that’s been created and run python PlexPy.py

Docker

The helpful people over at LinuxServer.io have made a Docker image that’ll get you running PlexPy in no time and was perfect for use on my Synology: https://hub.docker.com/r/linuxserver/plexpy/

Setting up

At this point, PlexPy will listen on TCP port 8181 on your machine so you should be able to fire up http://localhost:8181 in a browser (if it doesn’t do it automatically for you!).

You’ll now be prompted with the ‘PlexPy Setup Wizard’ which really makes it easy to get going quickly. You’ll be asked for a few details:

  1. Plex.tv Username & Password: Put your credentials in for plex.tv and hit ‘Authenticate’.
  2. Plex Media Server: Once authenticated you’ll be presented with a list of your Plex Media Servers. Choose the one you want PlexPy to look at.
  3. Monitoring: What do you want PlexPy to keep track of? You can enable Movie, TV Show or Music Logging (or all of them). Also choose the ‘Ignore Interval’ - an item must be playing for at least this long for PlexPy to track it.
  4. Notifications: Select whether you want to be notified when things happen on your Plex Media Server. PlexPy supports a huge bunch of events and notification methods.
  5. Database Import: If you have an existing PlexPy database, it’s possible to import it after the Setup Wizard is complete.

After this, the wizard is complete and you’re all set.

What’s next

With PlexPy running on your machine, it’ll now track any activity on your selected Plex Media Server and record it to a local SQLite database.

After a few days (or hours if you’re Plex mad) you’ll have some really interesting insights into your popular libraries and what your users are up to.

Play Count graph

Looks like we love music in the summer and movies in the winter in this house!

comments powered by Disqus

Recent Posts

About

I work both as a Technical Architect designing, deploying and supporting effective solutions on Amazon Web Services and as a freelance radio presenter.