Plex @ aTV - think different...

Hello Baa,

Now I am really confused too.

I changed the IP in the application.js file and Trailers DO STILL work as you said.

I attach a text file of the PlexConnect.py output from the pwd input stage.

BTW, one thing I did notice, although Trailers work for the Library menu, Channels, Music and Photos don't—I get the same Trailers are unavailable message...

Some more follow up—I think I see the pattern.

Next, I quit terminal and changed the application.js IP back to the address of the PMS machine.

I then used the same terminal sudo space and dragging the PlexConnect file into terminal to autocreate the path and lo and behold it DID NOT work—same Trailers unavailable message.

The pwd command in terminal showed I was not in the PlexConnect-XML_templates directory.

I cded into the PlexConnect-XML_templates directory and did exactly the same procedure again and it starts playing fine.

I don't whether this is a bug but it seems consistently reproducible.

Hope this helps.

nekton1: I guess, it is how I said:

>> \f0\fs24 \cf0 -bash-3.2$ \cf2 pwd\
>> /PlexConnect-XML_templates\
>> -bash-3.2$ sudo /PlexConnect-XML_templates/PlexConnect.py \cf0 \
Those lines are form your log (#161) (bad IPs in .js but working trailers). Your working directory already points to the directory PlexConnect is living in. That way, PlexConnect finds all the secondary files it needs. Life is good. :-D
With the next test (#162), a new terminal window is created, but the directory is NOT set to the PlexConnect-directory. Since it looks relative to the current path (which may in this case /root or /Users/[YourName], don't know right now), it won't find its resources.
 
Everything is good... I will try to implement better directory selection.
 
Channels non-functional: This wasn't implemented until about 2 days ago. How old are your sources? Grab the latest and it should be fine - for basic functionality at least.
Photos/Music non-functional: Yes. Known. No work done on those corners.

I am anctiously waiting for this to be rolled into the normal version of PMS. I wish I had skills to help.

One thing I was wondering about this way to get plex on non jailbroken Atv. Can this system point to a different DNS for netflix content. I use TUNLR to get american Netflix I love plex but also don;t want to loose my US netflix. 

...

>>rolled into PMS:

I kind of asked this question:

http://forums.plexapp.com/index.php/topic/65963-plex-webnodejs-and-xml-questions/?p=382665

Currently the answer is NO as far as I understood.

>> DNS:

Which DNS did you aTV use before you tried PlexConnect? Just put this DNS into the Settings.py file and other than Trailers, nothing should change. Doesn't that work?

I am curious as to the current state of the Plex interface using Plexconnect.

For example, can you access individual channels installed on PMS as well as the movie and TV libraries?

Thanks

Channels - Yes, although some work and some don't.

Movies - Yes

TV Shows - Yes

Why don't you give it ago and see.

As for the state of the interface, I'd say it looks rather nice. Still needs some work but it's very usable.

OK, I decided to take your advice and set up Plexconnect on my iMac and ATV 3. I did run into some issues, however.

First, I just need some clarification on setting up the DNS.

Here is part of the Settings script:

1. Plex Media Server def getIP_PMS(): return '192.xxx.xxx.xxx' # todo: auto-discovery (Bonjour, GDM?) def getPort_PMS(): return 32400 1. 

So for this, do I put in my home computer's DNS/IP, the computer on which PMS is running?

2. AppleTV/Client def getIP_aTV(): return '192.xxx.xxx.xxx' # todo: how about more than one aTV?  

Is this the DNS of my actual ATV as seen by my Router?

3. def getIP_DNSmaster(): # Router, ISP's DNS, ... return '208.122.23.23' 3.

And this is the DNS that I had set up in my ATV to use unblock-us to get American Netflix, I think?

At least, that is how I set it up but the problem was that ATV became stuck on getting date and time. This is after I manually changed the ATV DNS to be the same as #1 above.

The variable: I use a wifi extender for the network that this particular ATV is hooked into. It has a name like networkID_EXT and a different IP address than the home computer/PMS server. Do I have to account for this somehow?

Sorry about all the questions but I think I am almost there. Also, I had no problem sudoing the Plexconnect.py file and terminal showed that there was communication from the ATV although it listed the extender IP rather than the ATV IP as the source. Hmmm. Did I answer my own question here? Please let me know. Thanks

OK, I decided to take your advice and set up Plexconnect on my iMac and ATV 3. I did run into some issues, however. First, I just need some clarification on setting up the DNS. Here is part of the Settings script: # Plex Media Server def getIP_PMS(): return '192.xxx.xxx.xxx' # todo: auto-discovery (Bonjour, GDM?) def getPort_PMS(): return 32400 1. So for this, do I put in my home computer's DNS/IP, the computer on which PMS is running? # AppleTV/Client def getIP_aTV(): return '192.xxx.xxx.xxx' # todo: how about more than one aTV? 2. Is this the DNS of my actual ATV as seen by my Router? def getIP_DNSmaster(): # Router, ISP's DNS, ... return '208.122.23.23' 3. And this is the DNS that I had set up in my ATV to use unblock-us to get American Netflix, I think? At least, that is how I set it up but the problem was that ATV became stuck on getting date and time. This is after I manually changed the ATV DNS to be the same as #1 above. The variable: I use a wifi extender for the network that this particular ATV is hooked into. It has a name like networkID_EXT and a different IP address than the home computer/PMS server. Do I have to account for this somehow? Sorry about all the questions but I think I am almost there. Also, I had no problem sudoing the Plexconnect.py file and terminal showed that there was communication from the ATV although it listed the extender IP rather than the ATV IP as the source. Hmmm. Did I answer my own question here? Please let me know. Thanks

Wow, wall of text alert :)

OK, open Settings.py

getIP_PMS  -  This one is the address of the Computer running the PlexMediaServe

getIP_aTV  -  This is the IP address of the AppleTV, can be found by going to Settings/General/Network on th ATV and look at IP Address. However if you use a Wifi extender then the IP address of the ATV may be changed once it goes through the extender and into the router, if so look in the routers settings to see which IP address is assigned to the ATV and use that instead

getIP_DNSmaster  -  This is the DNS address the ATV uses when in normal use ie. Before using PlexConnect. Goto Settings/General/Network on your ATV and look for DNS.

Once all the changes have been made to Settings.py, save it. The run PlexConnect.py

Then on the ATV manually change the DNS address to the same address of the computer that is running PlexConnect (If your running it on the same machine as the PlexMediaServer then it will be the same address you used for getIP_PMS)

Then on the ATV launch the Trailer app.  

Thank you for the walk through. I followed these instructions but the trailer app times out when trying to connect. It says trailers cannot be found or something like that. PlexConnect running in terminal indicated that the ATV IP was trying to connect but, again, it didn’t, ultimately, work. I am sure I have done something wrong by I do not know what. By the way, I am on Snow Leopard which runs python 2.6.1. Would that matter?

By the way, I am on Snow Leopard which runs python 2.6.1. Would that matter?

Not sure, I'm developing it using python 2.7.3. Try updating and see, just don't use any of the version 3's, I think the latest version 2 is 2.7.4.

Not sure, I'm developing it using python 2.7.3. Try updating and see, just don't use any of the version 3's, I think the latest version 2 is 2.7.4.

First, I would like to thank everyone for the outstanding progress so far and your hard work shows.

Thank you for the walk through. I followed these instructions but the trailer app times out when trying to connect. It says trailers cannot be found or something like that. PlexConnect running in terminal indicated that the ATV IP was trying to connect but, again, it didn't, ultimately, work. I am sure I have done something wrong by I do not know what. By the way, I am on Snow Leopard which runs python 2.6.1. Would that matter?

Unfortunately, appears I have the same problem as the post above.  PlexConnect.py works for the redirects except for the PMS Trailers redirect.  My Web Server never gets established.  I believe it must be do to python 2.6.  I have updated to Python 2.7.4 with same results. 

The PlexConnect appears to request use of python @

   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py

However, the update Python 2.7.4 is located @   /Library/Frameworks/Python.framework/Versions/2.7

I have also attempted to place Python 2.7.4 at the same location as requested by PlexConnect but it errors out by stating missing Python 2.6.  Let me know how can contribute in order to fix this.  

Cezar

DNSServer : ***
DNSServer : Starting up.
DNSServer : intercept: trailers.apple.com
DNSServer : forward other to higher level DNS: 192.168.000.001
DNSServer : ***
WebServer : ***
WebServer : WebServer : Shutting down.
Process Process-2:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py", line 231, in _bootstrap
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py", line 88, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/CsM/PlexConnect-XML_templates/WebServer.py", line 115, in Run
    dprint(__name__, 0, "WebServer: Serving HTTP on {} port {}.", sa[0], sa[1])
  File "/Users/CsM/PlexConnect-XML_templates/Debug.py", line 22, in dprint
    print src,":", str.format(*args)
ValueError: zero length field name in format

>>Issues with Python 2.6

According to "http://docs.python.org/2/library/string.html" there was a change in 2.7 in the area of the format() command.

Changed in version 2.7: The positional argument specifiers can be omitted, so '{} {}' is equivalent to '{0} {1}'.

I am on 2.7.something myself, we did not yet test any previous version. We might just want to add the 0/1 into the brackets... could you test the new (well, old) syntax?
 

>> The PlexConnect appears to request use of python @

>>    /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py

PlexConnect does not request ANY python path at all. It all comes from your installation. We request "process.py" and depending on the interpreter running our script, the suitable (or not?) libraries got included.

I guess, that there is something wrong with your try to update to Python 2.7 - your shouldn't have to try to fit the new code into the old location. Please try to uninstall ALL python versions and get a clean install of either one. I am not sure, how you would switch between the two, if you installed both - I guess, you would have to deal with the path variable or so...

 

EDIT: WebServer is not started correctly, as it could not do the "dprint(__name__, 0, "WebServer: Serving HTTP on {} port {}.", sa[0], sa[1])" which would result in said .format() - "print src,":", str.format(*args)". Changing the list to "dprint(__name__, 0, "WebServer: Serving HTTP on {0} port {1}.", sa[0], sa[1])" might be a short-term fix, I just don't know, where else I used that syntax.

Thank you for the walk through. I followed these instructions but the trailer app times out when trying to connect. It says trailers cannot be found or something like that. PlexConnect running in terminal indicated that the ATV IP was trying to connect but, again, it didn't, ultimately, work. I am sure I have done something wrong by I do not know what. By the way, I am on Snow Leopard which runs python 2.6.1. Would that matter?

Same as above. 2.6.x does not support a "{} {}".format(x,y). It needs "{0} {1}".format(x,y)...

There might be more differences/incompatibilities, though.

Same as above. 2.6.x does not support a "{} {}".format(x,y). It needs "{0} {1}".format(x,y)...

There might be more differences/incompatibilities, though.

First off, I would like to apologize in advance.  I have never attempted to work on Python before.

I changed the first line of PlexConnect.py from "#!/usr/bin/python" to "#!/usr/local/bin/pythonw" and that did the trick.

PlexConnect.py began to use Python 2.7.4 and the WebServer started up.  However, I'm getting a new error and trailers app continues not to work.

DNSServer : Domain: trailers.apple.com
DNSServer : ***intercept request
DNSServer : -> DNS response: IP_PMS
192.168.0.136 - - [06/May/2013 17:49:17] code 403, message Not Serving Client 192.168.0.136
192.168.0.136 - - [06/May/2013 17:49:17] "GET /appletv/application.js HTTP/1.1" 403 -
 
I got this idea from http://docs.python.org/2/using/mac.html  4.1, 4.1.1 and 4.1.2

cezar...

>> First off, I would like to apologize in advance.  I have never attempted to work on Python before.

That's fine. There is always a first :-)

Your last error message says, that the PlexConnect WebServer does not want to serve any data to client 192.168.0.136 - basically because it doesn't believe it is your aTV. Reading through your various logs, my guess is, that your IP_aTV declaration in Settings.py is somewhat off -> you seem to have included leading "0"s, which are not  part of the standard format.

earlier post: >> DNSServer : forward other to higher level DNS: 192.168.000.001
last post: >> 192.168.0.136 - - [06/May/2013 17:49:17] code 403, message Not Serving Client 192.168.0.136
 
Please verify, remove the leading "0"s and try again...

cezar...

>> First off, I would like to apologize in advance.  I have never attempted to work on Python before.

That's fine. There is always a first :-)

Your last error message says, that the PlexConnect WebServer does not want to serve any data to client 192.168.0.136 - basically because it doesn't believe it is your aTV. Reading through your various logs, my guess is, that your IP_aTV declaration in Settings.py is somewhat off -> you seem to have included leading "0"s, which are not  part of the standard format.

earlier post: >> DNSServer : forward other to higher level DNS: 192.168.000.001
last post: >> 192.168.0.136 - - [06/May/2013 17:49:17] code 403, message Not Serving Client 192.168.0.136
 
Please verify, remove the leading "0"s and try again...

Baa your awesome, that worked.  I changed my Setting.py from "192.168.000.001" to "192.168.0.1"

Thank you very much.  

Let me know how I can be of assistance. 

Cezar

>> Baa your awesome...

Thanks! I'm glad I was able to solve this issue :-)

Hi, I am so sorry to be such a noob. You are all talking about things that I have never heard of before.

I have changed the DNS servers to what they should be in Settings.py and I know to you all this will sound stupid. "How do I run PlexConnect.py?"

Please be kind 

"How do I run PlexConnect.py?"

- Get a Python interpreter on your machine (see www.python.org). Depending on your OS you might already have one (MacOS usually OK, Windows not so much...).

- Open terminal/cmd window, type "cd [path to PlexConnect]" and "sudo ./PlexConnect.py". This should work, if your python is found as hinted in the first line of the python scripts. "sudo" (run with super user rights) is needed, as we need access to network ports 53 (DNS) and 80 (HTTP).

Thanks to everyone here. I had initially set the Chinese DNS server and the various githubs posted. The new PlexConnect worked great right away, thanks everyone.. This is much easier to follow than the creepily translated Chinese forums. I've been resistant to Plex for years but its obvious that you guys are the only ones doing the heavy lifting. Firecore and NitoTV seem all but dead it seems and this workaround really kills the need for an ATV3 jailbreak. I'm hoping this will allow me to extend my desktop rather than mirroring using some sort of VNC to server.