PlexConnect on ATV 7.0 GM (iOS 8.0 GM)

1. Once you generate a cert you want to keep it named trailers.cer so plexconnect can serve it.

Why keep it (or them) named `trailers'? I see no technical or practical justification for that. Naming the certificate(s) according to the app that's being intercepted seems much cleaner to me.

Ok, thanks for the info. 

I enabled PWS and served up my super mobileconfig file with all the certs in it and was able to install it.

I did try USB as well, but iPhone Configuration Utility would not allow me to remove the existing profile, nor install a new one.

I edited Settings.cfg to use the WSJ Live app's domain and pointed the certfile line to it's pem file. I'm guessing that might be the reason for mentioning to keep things named trailers.* as the default would be trailers.pem in there, though I had changed it to something else - imovie.pem

I got things working with WSJ Live, and I've not yet upgraded to the latest OS.

I'm about to try Flicker, as I like the icon, seems more movie like :D

** edit **

Flickr working good on the old OS. Just upgrading the box so we shall see how that goes.

If I have time at the weekend I might run through all the apps I have access to and see which ones can be used by PlexConnect.

All updated. Interface does look nice with the iOS 7 / 8 style. Flickr app still working with PlexConnect :)

So is there any hope for iMovie to ever work with PlexConnect or did something fundamentally change that won't ever allow it?

So is there any hope for iMovie to ever work with PlexConnect or did something fundamentally change that won't ever allow it?


It's likely some weird bug around one of the globals in XMLConverter.
By calling:

XMLConverter.setATVSettings(ATVSettings.CATVSettings())
XMLConverter.setParams(g_param)

right before:

XML = XMLConverter.XML_PMS2aTV(PMSaddress, self.path + query, options)

in WebServer.py, everything appears to work as before.
I don't really understand the language, so I'm not really sure about what's happening, but somehow, some globals in XMLConverter get "resetted".

So, I found an issue... If you purchase iTunes content alongside using PlexConnect on your ATV via the Trailers app, you will not be able to view/stream any of your purchased content while PlexConnect is enabled.  The ATV will return 'iTunes is currently unavailable' unless you switch back to automated (non-plexconnect) DNS.

I highly recommend that you do NOT upgrade to the latest ATV software if you purchase content through iTunes to stream through your ATV!

I'm currently testing a workaround with WSJ to make sure everything plays nicely.  I'll report back.

So, I found an issue... If you purchase iTunes content alongside using PlexConnect on your ATV via the Trailers app, you will not be able to view/stream any of your purchased content while PlexConnect will still work.  The ATV will return 'iTunes is currently unavailable' unless you switch back to automated (non-plexconnect) DNS.

I highly recommend that you do NOT upgrade to the latest ATV software if you purchase content through iTunes!

I'm currently testing a workaround with WSJ to make sure everything plays nicely.  I'll report back.

I have switched over to WSJ successfully (secure.marketwatch.com), and confirmed that I can still view and stream purchased content from iTunes.  Be sure to switch over if you use their store frequently!

???

I just wanted to confirm that applying the AppleTV update with the standard Trailers highjack worked flawlessly for me.

  • Switched DNS to automatic
  • Updated to new software version
  • Re-added my PlexConnect server as DNS
  • Everything works as before

The hijack worked fine for me too, but then I was unable to play content purchased through iTunes

???

I kid you not: With the attached diff, everything works correctly for "iMovie Theater" too. I don't really grok python. but the param and appletv settings turn out empty/None in the XMLConverter inside the SSL server.

diff --git a/WebServer.py b/WebServer.py
index fcbfcb8..e91564f 100755
--- a/WebServer.py
+++ b/WebServer.py
@@ -290,6 +290,11 @@ def Run(cmdPipe, param):
 def Run_SSL(cmdPipe, param):
     if not __name__ == '__main__':
         signal.signal(signal.SIGINT, signal.SIG_IGN)
+
+    setParams(param)
+    XMLConverter.setParams(param)
+    cfg = ATVSettings.CATVSettings()
+    XMLConverter.setATVSettings(cfg)
 dinit(__name__, param)  # init logging, WebServer process

So, I found an issue... If you purchase iTunes content alongside using PlexConnect on your ATV via the Trailers app, you will not be able to view/stream any of your purchased content while PlexConnect is enabled. The ATV will return 'iTunes is currently unavailable' unless you switch back to automated (non-plexconnect) DNS.

I highly recommend that you do NOT upgrade to the latest ATV software if you purchase content through iTunes to stream through your ATV!

I'm currently testing a workaround with WSJ to make sure everything plays nicely. I'll report back.


The hijack worked fine for me too, but then I was unable to play content purchased through iTunes


I'm using aTV3 7.0, latest PlexConnect and the trailers app, and purchasing, renting, playing and streaming from the iTunes store works perfectly fine.

I'm using aTV3 7.0, latest PlexConnect and the trailers app, and purchasing, renting, playing and streaming from the iTunes store works perfectly fine.

all of my purchased content also plays perfectly with a hijacked trailers app.

Ok, thanks for the info. 

I enabled PWS and served up my super mobileconfig file with all the certs in it and was able to install it.

I did try USB as well, but iPhone Configuration Utility would not allow me to remove the existing profile, nor install a new one.

I edited Settings.cfg to use the WSJ Live app's domain and pointed the certfile line to it's pem file. I'm guessing that might be the reason for mentioning to keep things named trailers.* as the default would be trailers.pem in there, though I had changed it to something else - imovie.pem

I got things working with WSJ Live, and I've not yet upgraded to the latest OS.

I'm about to try Flicker, as I like the icon, seems more movie like :D

** edit **

Flickr working good on the old OS. Just upgrading the box so we shall see how that goes.

If I have time at the weekend I might run through all the apps I have access to and see which ones can be used by PlexConnect.

If you could do that I could update the webserver.py file and the plex icon topic if you find the time  B) I recommend the network method to load certs it much easier to add/delete certs using no usb:

Network via PlexConnect (preferred)

Personally I use the ip of my OS with no http prefix to load any cert for example:

192.168.1.100/trailers.cer

I wonder if you can still load the custom plex icon on the new IOS.

Why keep it (or them) named `trailers'? I see no technical or practical justification for that. Naming the certificate(s) according to the app that's being intercepted seems much cleaner to me.

 

When you serve the icon via PlexConnect using the network method it must be named trailers.cer. The only way around this is having a separate webserver that can serve alternate named cert files unless you changed plexconnect's code which would be more of a pain. Thats why it would be best to follow the previous post (post #60) about how to keep multiple certs in folders then copy them into the serving certificate folder when needed to avoid confusion. Even if you name it trailers.cer it will load as whatever hijack you generated the cert as on the aTV. I only generated about 100+ certs for different hijacks and found the best method to load certs/hijacks to keep them in a logical order in folders to be served to the aTV if/when needed.

I kid you not: With the attached diff, everything works correctly for "iMovie Theater" too. I don't really grok python. but the param and appletv settings turn out empty/None in the XMLConverter inside the SSL server.

 
Ok. It was simpler than it sounded:
Process() creates actual processes (duh!) thru fork(), so the changes to the globals performed inside WebServer.Run() don't carry over to WebServer.Run_SSL().
Question is "how it ever worked before"? Even better question "Why does it work for Trailers"?
 
Example code:

#!/usr/bin/python

from time import sleep
from multiprocessing import Process

v=‘not changed’

def process_1():
global v
v=‘changed’
print “process_1 V: %s” % repr(v)
sleep(15)

def process_2():
global v

print "process_2 V: %s" % repr(v)
sleep(15)

print “create process 1”
proc1 = Process(target=process_1)
proc1.start()
sleep(5)
print “create process 2”
proc2 = Process(target=process_2)
proc2.start()
sleep(5)

print “waiting…”
proc1.join()
proc2.join()
print “done”

This patch changes from Process() to Thread() and everything works fine with iMovie Theater.

 

diff --git a/PlexConnect.py b/PlexConnect.py
index 6a179f3..5391898 100755
--- a/PlexConnect.py
+++ b/PlexConnect.py
@@ -11,7 +11,8 @@ inter-process-communication (queue): http://pymotw.com/2/multiprocessing/communi
 import sys, time
 from os import sep
 import socket
-from multiprocessing import Process, Pipe
+from multiprocessing import Pipe
+from threading import Thread
 import signal, errno
 
 from Version import __VERSION__
@@ -79,7 +80,7 @@ def startup():
     # init DNSServer
     if cfg.getSetting('enable_dnsserver')=='True':
         master, slave = Pipe()  # endpoint [0]-PlexConnect, [1]-DNSServer
-        proc = Process(target=DNSServer.Run, args=(slave, param))
+        proc = Thread(target=DNSServer.Run, args=(slave, param))
         proc.start()
         
         time.sleep(0.1)
@@ -93,7 +94,7 @@ def startup():
     # init WebServer
     if running:
         master, slave = Pipe()  # endpoint [0]-PlexConnect, [1]-WebServer
-        proc = Process(target=WebServer.Run, args=(slave, param))
+        proc = Thread(target=WebServer.Run, args=(slave, param))
         proc.start()
         
         time.sleep(0.1)
@@ -108,7 +109,7 @@ def startup():
     if running and \
        cfg.getSetting('enable_webserver_ssl')=='True':
         master, slave = Pipe()  # endpoint [0]-PlexConnect, [1]-WebServer
-        proc = Process(target=WebServer.Run_SSL, args=(slave, param))
+        proc = Thread(target=WebServer.Run_SSL, args=(slave, param))
         proc.start()
         
         time.sleep(0.1)
diff --git a/WebServer.py b/WebServer.py
index fcbfcb8..7b3746f 100755
--- a/WebServer.py
+++ b/WebServer.py
@@ -21,7 +21,6 @@ from SocketServer import ThreadingMixIn
 import ssl
 from multiprocessing import Pipe  # inter process communication
 import urllib
-import signal
 
 import Settings, ATVSettings
 from Debug import *  # dprint()
@@ -240,9 +239,6 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
 
 
 def Run(cmdPipe, param):
-    if not __name__ == '__main__':
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
-    
     dinit(__name__, param)  # init logging, WebServer process
     
     cfg_IP_WebServer = param['IP_self']
@@ -277,7 +273,6 @@ def Run(cmdPipe, param):
             server.handle_request()
     
     except KeyboardInterrupt:
-        signal.signal(signal.SIGINT, signal.SIG_IGN)  # we heard you!
         dprint(__name__, 0,"^C received.")
     finally:
         dprint(__name__, 0, "Shutting down.")
@@ -288,9 +283,6 @@ def Run(cmdPipe, param):
 
 
 def Run_SSL(cmdPipe, param):
-    if not __name__ == '__main__':
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
-    
     dinit(__name__, param)  # init logging, WebServer process
     
     cfg_IP_WebServer = param['IP_self']
@@ -339,7 +331,6 @@ def Run_SSL(cmdPipe, param):
             server.handle_request()
     
     except KeyboardInterrupt:
-        signal.signal(signal.SIGINT, signal.SIG_IGN)  # we heard you!
         dprint(__name__, 0,"^C received.")
     finally:
         dprint(__name__, 0, "Shutting down.")

When you serve the icon via PlexConnect using the network method it must be named trailers.cer. The only way around this is having a separate webserver that can serve alternate named cert files unless you changed plexconnect's code which would be more of a pain.


Assuming you mean certificate rather than icon, what you say does not match what I see. I obtain the cert not with the local IP address but the intercepted DNS name.

>> When you serve the icon via PlexConnect using the network method it must be named trailers.cer. The only way around this is having a separate webserver that can serve alternate named cert files unless you changed plexconnect's code which would be more of a pain.

Not quite... there is a setting for the certificate's name.

>>Question is "how it ever worked before"? Even better question "Why does it work for Trailers"?

Yeah. Good question.

My guess: The SSL connection was never used to pull in anything other than application.js - no XMLs, nothing. I just don't get, why now iMovie would request anything more on that link?

>> When you serve the icon via PlexConnect using the network method it must be named trailers.cer. The only way around this is having a separate webserver that can serve alternate named cert files unless you changed plexconnect's code which would be more of a pain.

Not quite... there is a setting for the certificate's name.

How would one do so so the .cer and .pem would work/serve properly? 

How would one do so so the .cer and .pem would work/serve properly? 

Change setting, restart PlexConnect?

As far as I remember, WebServer looks at the name, skipping the extension, and provides the correct cert and format.

Actually, this allows you to install the cert by just entering "/.cer" in your aTV to pull in the correct file - but I guess proposing that might only add confusion...