[Release] Plex Media CLIent (Linux only)

Hello! For the past few months I’ve been developing a command line Plex client for Linux and, much of a toy project it is, I think it is mature enough to be published. I use it as my daily driver, at least.

It is essentially a bunch of horribly garbled Lua code talking to the Plex API and driving an mpv instance to play media. For some mystery, it even seems to work most of the time :smile:

Features currently implemented:

  • Plex account login
  • Navigation by library with an interface similar to youtube-viewer
  • Rudimentary search in library
  • Support for items with multiple versions
  • Support for items made up of multiple parts
  • Support for external subtitle files
  • Playback progression save and resume
  • A memory footprint that’s a fraction of PMP’s (normally <20MB, not including mpv)
  • No client-side telemetry :stuck_out_tongue:

I plan to look into global and more sophisticated search, server discovery (right now you need to manually specify your server’s address), transcoding and podcasts eventually.

There is an annoying behavior where all Lua JSON parsers I’ve found keep persistent in-memory buffers that can only grow, never shrink. So if you encode/decode a big enough payload, memory consumption can reach hundreds of MBs (for pathological cases, like search queries returning ~50k entries, I’ve had it reach ~250MB… yikes!) and it will never go down, even when technically there is no longer any need for buffers that big. If anybody happened to have any suggestions in this regard I’d appreciate them; the nuclear option is to move to lunajson (SAX-like streaming parser).

Also, at some point I’d like to rewrite the program so it loads as an mpv script and it can just drive a single, persistent mpv instance from the internal API. Right now it works by launching mpv on demand and accessing needed functionality through its JSON IPC protocol via socket.

Anyways, there you have it. If you’re on Linux and would prefer a more minimalist approach to Plex, this might strike your fancy. Bug reports, suggestions and comments are all very welcome!

EDIT - A tiny demo to show the interface:

asciicast

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.