As some of you may have found out or read about, Apple trailer downloads for Linux are currently broken. Apple has implemented a Quicktime user agent check prior to downloading. Personally I agree with the decision because Apple is concerned about the quality of reproduction (though Apple trailers still play with an odd hue on Windows – think this has to do with Quicktime not correctly reading Window’s color setting – but I’m getting off topic). This means that movie players plugins for web browsers (like gecko-mediaplayer and totem) will no longer work. Until gstreamer gets a patch that fix’s this, here’s a script that can download them manually. To use the script, right-click on the download link and copy it to the clipboard then append it after the atget script.
You can comment wget line and uncomment the mplayer line to directly play the trailer. The mplayer line needs to have a cache to be sure the video is downloaded before it start or errors will occur (200MB should be enough for just about and video on the site).
Credits
- Thanks to Ian on stack overflow, who help me figure out how to prepend a regex search.
Great script. Many thanks. :)
Would it be possible to modify the script to allow downloading of multiple trailers in queued fashion?
> Great script. Many thanks. :)
No problem. Glad you could make use of it.
> Would it be possible to modify the script to allow downloading of multiple trailers in queued fashion?
Yeah, that’s definitely possible. I’ll see if I can get to in in the next couple days.
Btw, check out the update to the post you’ve linked to (http://mirzmaster.wordpress.com/2009/08/20/apple-movie-trailer-downloads-are-broken/). HD-trailers.net claim that simply changing the URL from movies.apple.com to http://www.apple.com should permit direct download (without a User Agent switch)
Good tip. Wonder though if Apple will make that link eventually require a user agent too.
Thanks for the post. I updated my wget with “-U” flag and the user agent code used with mplayer in your code so I can download trailers again.
That was helpful, thanks!
By the way, what do you use to insert the code snippets? Just manually wrap them in
Right, the comments DO allow html tags. Here’s what I wanted to post:
Just manually wrap them in <pre> and <div> with a custom CSS style?
Thank you.
For the css I use a html/css editor call Arachnophilia and create my own custom tags. It was a pain to sort out because they can sometimes conflict with the built in ones but if you find the right scheme they can work nicely. Here’s my bash script one in case you can use it:
<pre><div style="overflow: auto; width=auto; border: solid #c8c8c8; border-width: .1em .1em .1em .8em; padding: .2em .6em .2em .6em; background-color: #dddddf; font-size: 1em;white-space:pre;">|</div></pre>
Thanks for droppin’ in.
Thanks mate, works great!
@Gen2ly: I wrote a small app to automate the snippets highlighting, feel free to use it.
Hey cool! Nice. Just had a few things come up though that you should probably know about. I discovered that using div tags for code causes the browser to use western-encoding which I think uses microsoft font (i.e. not UTF-8) encoding. Therefore in the process converts a few characters over to microsoft font value. I particularly had problems with quotes. I’ve since written a new css box with a formatted pre tag that gets the expected behavior:
<pre style="overflow: auto; width=auto; border: solid #c8c8c8; border-width: .1em .1em .1em .8em; padding: .2em .6em .2em .6em; background-color: #dddddf; font-size: .9em;white-space:pre;"></pre>
Try it out if you like and tell me what you think.
The method I’m using at hilite.me seems to work fine with Unicode characters and quotes:
I’m actually using a pre <tag> wrapped in <div>, not the other way around. It’s the default method of Pygments – the highlighting library I use. I think it’s functionally equivalent to what you are doing with a single <pre> tag.
Yeah, I didn’t have problems with it until recently. The problems I have encountered to could be from a number of problems but I have had a couple people tell me that they had problems with the code boxes. I tested this method out on those trouble scripts. I’m not sure it’s quotes, could be with non-breaking spaces… So if it works for you…
Hey, Gen2ly, your readers may find that in the last few days Apple again broke trailer downloads. I’ve written up a tutorial on using Firefox, Greasemonkey, and a user agent hack to get it working again:
http://mirzmaster.wordpress.com/2009/10/09/helpful-hints-apple-movie-trailers-download-using-firefox-greasemonkey-and-user-agent-hack/
Thanks!
I’d thought I’d post this because it’s pretty dang cool. Got this from lollicon on the forums and it reads the Apple trailer webpage and gets the current trailers lists for the opening weekend, then prompts which one to download:
Just wanted to say thanks for this. Not so much the script (though that is neat), but for the information on what Apple was using to block my access and what to add to wget to get it back. Silly Apple.
You rock! :) Was trying to find an easy way to do this for some time! :)
Sadly not working here.
./qt http://movies.apple.com/movies/independent/captainaburaed/captainaburaed_720p.mov
–2010-01-20 20:30:09– http://movies.apple.com/movies/independent/captainaburaed/captainaburaed_h720p.mov
Resolving movies.apple.com… 72.246.30.59, 72.246.30.72
Connecting to movies.apple.com|72.246.30.59|:80… connected.
HTTP request sent, awaiting response… 302 Moved Temporarily
Location: http://www.apple.com/trailers/ [following]
–2010-01-20 20:30:09– http://www.apple.com/trailers/
Resolving http://www.apple.com... 72.247.109.15
Connecting to http://www.apple.com|72.247.109.15|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 24243 (24K) [text/html]
Saving to: `/home/rob/Desktop/captainaburaed_720p.mov’
100%[======================================>] 24,243 –.-K/s in 0.06s
2010-01-20 20:30:09 (366 KB/s) – `/home/rob/Desktop/captainaburaed_720p.mov’ saved [24243/24243]
Thanks, that’s a good idea!
I have pimpt the original script a little bit. With this version you can save the links you want in a file and download one after one automaticaly in a predifined place.
#!/bin/bash trailerdir="/home/username/trailers" mkdir -p "$trailerdir" || exit 1 trailerfile="${trailerdir}/trailers.txt" if [ ! -f "$trailerfile" ]; then echo "the trailer-link-file doesn't exist at \"$trailerdir\"" fi # first trailer link trailer="$(head -n1 $trailerfile)" while [ "$trailer" != "" ]; do # Prepend 'h' before resolution to create a valid url newurl=$(echo $trailer | sed 's/_\([0-9]*[0-9][0-9][0-9]\)p.mov/_h\1p.mov/g') # Download trailer and save to the desktop wget -U QuickTime/7.6.2 "$newurl" -O "${trailerdir}/${trailer##*/}" || exit 1 # Play trailer with mplayer (using 200MB cache to be sure trailer is dl'd first) #mplayer -cache 200000 -user-agent 'QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)' $newurl sed "/$(echo $trailer | sed 's/.*\///')/d" "$trailerfile" > "${trailerfile}.tmp" mv "${trailerfile}.tmp" "$trailerfile" trailer="$(head -n1 $trailerfile)" donethank you for sharing this information … nice
i always watch moview trailers on youtube, it is really fun to watch so many movie trailers at once “‘*
[...] A “solution” for watching them: #!/bin/bash # atget – download trailers from Apple website # Usage if no parameters given if [ -z $@ ]; then echo " atget "; exit fi # Prepend 'h' before resolution to create a valid url newurl=$(echo $@ | sed 's/_([0-9]*[0-9][0-9][0-9])p.mov/_h1p.mov/g') # Download trailer and save to the desktop wget -U QuickTime/7.6.2 "$newurl" -O $HOME/Desktop/${@##*/} From Linuxtidbits. [...]
[...] LinuxBits [...]
To us, who aren’t techie and have no knowledge about these codes is always a challenge, good thing to have such information and post like this around to keep us updated with whats new. Thanks.
I need to to thank you for this fantastic read!! I certainly loved every little bit of it.
I have got you bookmarked to check out new stuff you post…
Don’t purchase every single dress in distinct shop. In case you are mostly of the items are often, inform the mediocre ones head over to shop your own dresses inside the exact same store. They’ll absolutely offer you a price cut, if your most people the wedding social gathering accept have got a keep shopping, such as the bride, the consideration and also the floral females. The charge will likely be a lesser amount of in case every body acquire attire available as one special shop. Maybe you must take your spending budget into mind, and check your very best self to buy the budget bridesmaids gown.