PlexConnect: Connecting Plex and the Apple TV

The Apple TV is aniftylittle device but it’s nowhere close to being able to play anything you want. It cannot play from USB drives. And it can’t play network shares either. Not from AFP, not from SMB, not from DLNA. There’s no app store for the Apple TV (yet) so there’s not installing and running the Plex Player app. So it can’t play from from Plex Media Server either. At least not directly.

Fortunately, there is a workaround:PlexConnect. And it is genius! You see, some of the built-in Apple TV apps get their UI and content from remote web servers. So it was a matter of hijackingthe web traffic to from one of these apps and redirect it to PlexConnect running on local machine. PlexConnect then communicates with Plex Media Server and serves up modifiedUI and content to the hijacked app on the Apple TV. Of course, the hijacked app won’t work as before anymore.

Normally the hijackedapp is the Trailers app. But since I didn’t have the Trailers app on my Apple TV, I used the WSJ app instead. If you have the same situationthen in the instructions below replaceof “trailers” with”wsjapp” and replaceof “trailers.apple.com” with”videoapisecure.wsj.com

Here are the consolidated instructions (from https://github.com/iBaa/PlexConnect/wiki/Install-Guide) for Mac OS X:

1. Install Plex Media Server
2. Download PlexConnect (https://github.com/iBaa/PlexConnect/archive/master.zip)
3. Extract and drag PlexConnect-master to the Applications folder
4.Open a terminal window (Terminal.app on Mac) and run the following command

openssl req -new -nodes -newkey rsa:2048 -out ~/Desktop/trailers.pem -keyout ~/Desktop/trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com

 

openssl req -new -nodes -newkey rsa:2048 -out ~/Desktop/wsjapp.pem -keyout ~/Desktop/wsjapp.key -x509 -days 7300 -subj “/C=US/CN=videoapisecure.wsj.com

5. This will create two files on your desktop: trailers.key and trailers.pem(orwsjapp.key and wsjapp.pem). Next run the following command:

openssl x509 -in ~/Desktop/trailers.pem -outform der -out ~/Desktop/trailers.cer && cat ~/Desktop/trailers.key >> ~/Desktop/trailers.pem

openssl x509 -in ~/Desktop/trailers.pem -outform der -out ~/Desktop/wsjapp.cer && cat ~/Desktop/wsjapp.key >> ~/Desktop/wsjapp.pem

Three files should now be on your desktop trailers.pem, trailers.key, and trailers.cer. (or wsjapp.pem, wsjapp.key, and wsjapp.cer).

6. Place the.pem and.cer files into the following folder:

/Applications/PlexConnect-master/assets/certificates/

7. If you’re hijackingthe WSJ app, you need to editthe PlexConnect configuration:

/Applications/PlexConnect-master/Settings.cfg

Sethosttointercept to “videoapisecure.wsj.com“:

hosttointercept =videoapisecure.wsj.com

8. If you’re hijacking the WSJ app, you need to edit the Settings script:

/Applications/PlexConnect-master/Settings.py

Change line 35 to (note the red dash):

(‘hosttointercept’ , (‘trailers.apple.com’, ‘[a-zA-Z0-9_.]+’)),

9. Run PlexConnect by first opening a terminal window (Applications -> Utilities -> Terminal), then type the following:

sudo “/Applications/PlexConnect-master/PlexConnect.py”

Provide your Administrator password to complete PlexConnect startup.

You should now see messages like these in the terminal window: PlexConnect Terminal

Write down the IP_Self: ###.###.###.### address. This is theIP of your PlexConnect server

SelfIP

On the Apple TV, choose Settings > General > Network > Wi-Fi. Then Choose your Wi-Fi network Name WifiSettingsChange the DNS setting from “Automatic” to “Manual”. WifiDNSEnter the IP of your PlexConnect server as the DNS server.DNSIP

Go to the AppleTV settings menu.Select General then scroll the cursor down to highlight Send Data To Apple and set to “No”.

With “Send Data To Apple” highlighted, press Play (not the normal Select button) and you will be prompted to add a profile.

Enter (without the quotes): “http://trailers.apple.com/trailers.cer” (or “http://videoapisecure.wsj.com/wsjapp.cer“)

Launch the Trailers (or the WSJ app).

Now you can play media from your Plex Media Server library on your Apple TV.

Enjoy!

UPDATE 6-22-15: Changed from old “secure.marketwatch.com” to new “videoapisecure.wsj.com”.Based on discussion athttps://forums.plex.tv/index.php/topic/168109-plexconnect-suddendly-stopped-working/.