Created
June 1, 2012 12:35
-
-
Save Gen2ly/2851829 to your computer and use it in GitHub Desktop.
Download trailers from Apple website
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download trailers from Apple website | |
saveloc="~/Desktop" | |
# Usage if no parameters given | |
if [[ -z $@ ]]; then | |
echo " atget <apple-trailer-url>"; 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/_h\1p.mov/g') | |
# Download trailer and save to the desktop | |
wget -U QuickTime/7.6.2 "$newurl" -P "$saveloc" -O ${@##*/} | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment