Plex @ aTV - think different...

Hi guys, this is really promising. Thanks for all the hard work.

f00b4r,

I don't think you need to set the location in the preference to "United States" if you're in the UK.  Because the "apple trailer" app is not shown if the location is set to "China". That's why the original hack post required the location set.

OK, I've found the problem, it seems that on 5.0.2 firmware the trailer app looks for application.js in a different location, thats easily fixed. But it also seems that the top menu bar is coded differently, thats harder to fix. In the mean time I've removed the top menu bar and reuploaded the zip package:-
 
http://www17.zippyshare.com/v/84254696/file.html
 
Delete the entire ATVBrowser directory and all it's contents and use the new one, I've uploaded. Let me know how it goes, by the way are you using it on Windows or Mac?
 


Using it on a Mac; I have all my blobs saved as was going to take it back to 4.4.4 anyway but I can help test the different firmwares.

Hi guys, this is really promising. Thanks for all the hard work.
 
f00b4r,
I don't think you need to set the location in the preference to "United States" if you're in the UK.  Because the "apple trailer" app is not shown if the location is set to "China". That's why the original hack post required the location set.


Ah that makes sense.

...Very curious to find out what this little project might turn into...

Me, too!  :D

I have been speaking with hippojay, the guy behind the PleXBMC plugin, about this.

Javascript is not really his field but he is willing to help with understanding the plex XML structures and other internals that he has picked up, this could really be a massive help if anyone was to volunteer some javascript skills.

I am wiling to help organise, coordinate and document (i am from an IT background but not programming unfortunately).

Message me or post in the thread if you want to help with this; once we have a few people together i would like to throw some ideas around about possible implementations.

Yeah... javascript is not my thing, either.

But I learned my (baby-) steps in python recently - currently trying to get a python-based DNS Server running (examples are widely available). Add a small python WebServer and we should be good to get something like the PleXBMC plugin running!

So I had a playaround this morning to see if I could setup a DNS to trap requests to the Apple trailer site from the ATV.

I installed  a small DNS server on my Windows box and set it to monitor and forward requests from the ATV to my ISP's DNS. I then entered and exited the Trailer app on the ATV to see what requests were being made.

This is where things get weird each time I enter and exit the Trailer app I get a different request. These are the first 3 I got:-

a772.w11.akamai.net forwarded to Forwarding Server 194.168.4.100
a772.w11.akamai.net resolved from Forwarding server as 23.65.22.169
a771.da1.akamai.net forwarded to Forwarding Server 194.168.4.100
a771.da1.akamai.net resolved from Forwarding server as 62.252.168.59
upp.itunes.apple.com.akadns.net forwarded to Forwarding Server 194.168.4.100
upp.itunes.apple.com.akadns.net resolved from Forwarding server as 17.173.66.77

I tried redirecting http://trailers.apple.com/ but nothing happens. So now the problem is how to know which request to redirect if it changes randomly? Maybe I'm just missing something, anyone have any ideas?

roidy:

As I wrote earlier, I am working on setting up a DNS Server in python. But currently I am haveing the same exact issue you did some days ago: I get those "a772.w11.akamai.net" addresses, not the expected "trailers.apple.com" domain. What did you do to fix this?

Those servers, if I remember right, are the 3rd party distributed content delivery servers that a lot of companies use for distributing media content around sections of the globe.


Hopefully we can get some more people interested in this.

This sounds promising keep it up guys =)

roidy:

As I wrote earlier, I am working on setting up a DNS Server in python. But currently I am haveing the same exact issue you did some days ago: I get those "a772.w11.akamai.net" addresses, not the expected "trailers.apple.com" domain. What did you do to fix this?

As f00b4r said those are just local 3rd party content servers, so you don't have to access say a US server if you live in the UK. But that wasn't the actual cause of the problem I was having. Firstly does your DNS work when trying to access the iTunes store or YouTube from the ATV? If not then there's a bigger problem with your DNS.

The cause of my problem was that I assumed that on first running the trailer app it just called the index.xml file from the trailers.apple.com site, but it doesn't, the first thing that gets called is a jarvascript file called application.js. This file is in a different location depending on which firmware you are running.

If you're running 5.0.2 then the location is trailers.apple.com/appletv/application.js

If you're running 5.2.1 then the location is trailers.apple.com/appletv/us/js/application.js

roidy:

Thanks, I figured it out. On my side, the issue was, that the "trailers.apple.com" address doesn't get resolved every time you select those trailers. It was just some bad thinking on my side.

Now I can block/intercept this request... while providing a good response when asked for all the other addresses. Don't know, if the js-DNS server did that (I haven't found it in the code...) - so, was the rest of aTV dead when running it through the server?

In the meantime, I got a small python DNSServer running... Is there any way to attach a file here?

Next step: python WebServer.

The node.js DNS also correctly handles the other ATV traffic, the store, YouTube and everything else still works fine, only the trailer requests are redirected. Easiest way would be to post it to somewhere like http://pastebin.com then post the link here. I'd be very interested to see it.

Here you go...

http://pastebin.com/equgZ69e (link expired in a month or so)

Excellent, give me 2 minutes and I'll test it out on my Windows machine for you .

The DNS works on it's own, but if I try and run my node.js web server to serve up pages the DNS fails to redirect trailers and fails to pass through the store/YouTube.

The DNS works on it's own, but if I try and run my node.js web server to serve up pages the DNS fails to redirect trailers and fails to pass through the store/YouTube.

Yes, DNS Server works. I haven't run it against a WebServer yet - didn't want to install this node.js.

YouTube works fine on my side, as well as the iTunes movie pages.

Not sure how it would interact with the node.js server. I will have to work on the server a bit more and see how things turn out!

...and here is the low level WebServer (python):

http://pastebin.com/6EyRe0yh (again, expires in a month. we should have better code by then :-)

As we need to serve port :80, you have to "sudo" it.

Also, run it in the ATVBrowser directory from where the node.js implementation worked. It opens access to the "assets" directory.

It runs fine on my Mac, I get access to roidy's small XML database (Movies/TVShows) + the thumbnails. YouTube and Apple Movies are still accessible as well. I guess this is what we need.

By the way... I haven't seen the new version of TRON yet :-)

Hi Baa, just tried both your DNS and Web server on my Windows box and they work fine, just a couple of points:-

1. In the DNS you use import fcntl, however you don't seem to use any of it's functions and fcntl isn't implemented under Window and so it gives an error. It needs to be removed.

2. The web server seems to be very slow at serving up the pages, taking around 5 seconds to load a page, where as the Node.js web server loads them instantly. For me at least, could be a Windows thing.

Great work on getting a python version running. The new Tron's a fantastic film, especially if you like sci-fi.

Hi,

I was wondering, how does Apple Add more Icons to to the ATV without updating iOS? Like the iTunes Festival Icon.

Would it be possible to add an Plex Icon to ATV with this method? Does anyone know how this is done?

Regards

Vlaves

Hi,

I was wondering, how does Apple Add more Icons to to the ATV without updating iOS? Like the iTunes Festival Icon.

Would it be possible to add an Plex Icon to ATV with this method? Does anyone know how this is done?

Regards

Vlaves

Because, like iTunes the ATV home screen is in essence a browser.

Apple in effect changes the home page; try disconnecting your ATV from the internet and watch the icons disappear.

In theory it may be possible to add a Plex specific icon to the home page but it is much easier for the moment to just reuse one of the current "app icons".