download apple trailer

categories: code

It is easy to find out why one can not just download the movie trailers at apple.com and how to fix it but I automated it even further using this small script which gives me the direct commands for downloading the 1080p content, which is the reason I use apple trailer in the first place instead of youtube. I also recently discovered that some trailer pages already have the h prepended to the download urls so this is also taken care of by the following small script:

import urllib2, re, sys

if len(sys.argv) != 2:
print "supply apple trailer url"
exit()

f = urllib2.urlopen(sys.argv[1]+'/includes/playlists/web.inc')
urls = re.findall('http://trailers.apple.com/movies/[^"\']+1080p.mov', f.read())

for url in urls:
print "wget -U quicktime "+re.sub("(?<!h)1080p.mov$", "h1080p.mov", url)
View Comments
blog comments powered by Disqus