Here’s my latest project: HD-Trailers.net
First, I attempted to do this with a blog: HD Trailers, however I thought it would be much cooler if I could represent in a much easier to use interface. So I started playing around ideas. The 1st part was coming out with a data structure that would be easily extensible. I thought about XML at first, but I’m not that familiar with PHP and their XML encoding/decoding. I ended up taking the easy way out and am using the included serializer for PHP, which turned out quite useful.
This started as a pet project because I enjoy checking out movie trailers and I definitely enjoy watching stuff in high definition (especially 1080p). However, neither Apple and Yahoo make it easy to download these trailers and I don’t particularly like being forced to watch it in Quicktime, since the free version Quicktime doesn’t allow full screen and is actually quite a poorly written video player. I’d much prefer to watch it in Media Player Classic or VLC.
I’ve figured the trick to download Apple HD trailers awhile back, and recently started collecting trailers from Yahoo! Movies. I do have to say that trailers at Yahoo! Movies are typically sub par when compared to their Apple counterpart, but they also have some non-overlapping HD trailers (like Transformer and Golden Compass).
The parsing of Yahoo’s HD trailers page was actually a bit more difficult than Apple’s. I actually had to download a qtl which redirects me to makeplaylist.dll and includes the SID to the trailer file. It took me awhile to figure out that in order to download the correct qtl file, the referrer has to be within Yahoo’s domain, which was easy to set up with PHP’s curl.
Halfway through my project, Apple decided to change their trailers page completely and I thought I was screwed. However, Apple switched to JSON (Javascript Object Notation) and in the latest PHP, they support JSON decoding, so that made my life even simpler and also gives me additional data which I wasn’t collecting before.
I just finished the caching system, where instead of parsing in the data table and creating the entire page for every load, it’ll be loading from a static class unless something triggers it to to delete the cache. The data is automatically updated every 24 hours and is smart in the fact that the cache will only be deleted if changes have been made. Individual movie pages also have a similar caching system.
HD-Trailers.net….great page. Thanks so much for the easy downloads versus yahoo and apple. Would really appreciate though if you could explain how you did the yahoo embedded qtl downloads. Tried saving the qtl and using notepad copying what I think is the correct url and pasting into media player 11 which I’m able to play .mov files on with an alternative methold. Any help would be greatly appreciated. Just so you know, if you don’t already…the codec used in combination with the alternative method and media player 11, plays much more smoothly than either quicktime, itunes, or real player. I was able to figured out apple’s embedded trailer site. Thanks again.