Skip to content

Overview

moodyblue edited this page Dec 20, 2021 · 14 revisions

Plex Connect (or "Plex @ aTV - think different…")

We all want the pleasure of Plex on the big screen - in this case driven by an AppleTV, unfortunately:

  • there is no App Store for the AppleTV.
  • only certain firmwares on the AppleTV2 have an untethered jailbreak
  • it is not possible to move between AppleTV2 firmwares unless the user has previously used a tool to specifically save unique signatures for their device

How does it work?

The basic idea is, to:

  • reuse a native AppleTV app (the default is "Trailers")
  • reroute the Trailers app requests to your local Plex Media Server
  • rework the reply to fit into AppleTV's XML communication scheme
  • let iOS do the rest
  • enjoy Plex on your unmodified AppleTV

More detailed Information about the files

  • PlexConnect.py - Main script file, invoking the DNSServer and WebServer into seperate processes.
  • PlexAPI.py - Collection of Plex Media Server/MyPlex "connector functions": Auto discovery of running PMSs: Good Day Mate! // XML interface to local PMSs // MyPlex integration
  • DNSServer.py - This is a small DNS server (hence the name) that is now called whenever aTV needs to resolve an internet address. To hijack the trailer App, we will intercept and re-route all queries to trailers.apple.com. Every other query will be forwarded to the next, your original DNS.
  • WebServer.py - This script provides the directory content of "assets" to aTV. Additionally it will forward aTV's directory requests to PMS and provide a aTV compatible XML back. Every media (video, thumbnails...) is URL-wise connected to PMS, so aTV directly accesses the Plex database.
  • XMLConverter.py - This script contains the XML adaption from Plex Media Server's response to valid aTV XML files.
  • Settings.cfg - Basic settings collection. Creates Settings.cfg at first run - which may be modified externally.
  • ATVSettings.py - Handles the aTV settings like ViewModes or Transcoder options. Stores aTV settings in ATVSettings.cfg.
  • Localize.py - Holds a couple of utility functions for text translation purposes. Uses dictionaries from assets/locales/.
  • Subtitle.py - Subtitle parser functions for PlexConnect's own renderer, converts subs to JSON for easy transfer to aTV.
  • PILBackgrounds.py - Modify and cache fanart images for use by aTV.

License and Disclaimer

This software is open-sourced under the MIT Licence (see license.txt for the full license). So within some limits, you can do with the code whatever you want. However, if you like and/or want to re-use it, we really appreciate a Donation.

The software is provided as is. It might work as expected - or not. Just don't blame us.