Skip to content
Tags

Downloading movie trailers from trailers.apple.com

2010/12/13

Sounds easy, doesn’t it? Well, it isn’t, at least if you’re using Linux, which isn’t supported by QuickTime.
Still, you can download the trailer and MPlayer (don’t know about other media players) can play the files, you might think. Wrong again – the download button on the trailer pages doesn’t actually link to the media file.

Instead, you get a file (something.mov) containing one line:

crypticstuff filename

Now, after downloading some of these files I noticed there’s always the same difference between the file I downloaded and the filename in the file. Take for example the „Sam Meets Castor“ trailer from Tron Legacy. The file the download button links to is called

tron-sammeetscastor_1080p.mov

The filename in there is

tron-sammeetscastor_h1080p.movrmdr

Only two things are different: there’s an „h“ prepended to the resolution (which is the important part) and „rmdr“ is appended at the end of the filename. The latter can be dismissed.
Now take the download link of the trailer, add the „h“ at the appropriate place (let’s call this the „real link“) and download that – doesn’t work. Well, after some time with google I found out that apple only offers the real file to clients with a useragent containing „QuickTime“. Luckily wget has an option to change the useragent:

-U agent-string
–user-agent=agent-string
Identify as agent-string to the HTTP server.

Now, let’s try again:

wget -U Quicktime/7.6.2 $real_link

Now we have the real file and can play it with MPlayer!

But to be honest, copying the link, modifying it, passing it to wget for every trailer seems a bit hard – can’t that be automated? Indeed it can: simply download the script I wrote: appletrailer from github to a directory somewhere in your $PATH. Every time you start it, you’ll be asked for the url you get from Apples download button. The file is then downloaded into the directory specified at the beginning of the script and, if you want, it will automatically be played with mplayer.

Advertisements

From → Linux

Schreibe einen Kommentar

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

%d Bloggern gefällt das: