Skip to content

Instantly share code, notes, and snippets.

@oker1
Forked from dnet/videotar.sh
Created October 15, 2011 08:58
Show Gist options
  • Save oker1/1289296 to your computer and use it in GitHub Desktop.
Save oker1/1289296 to your computer and use it in GitHub Desktop.
MTV videotár player (Mac OS + VLC)
#!/bin/sh
# MTV videotar player
if [ $# -lt 1 ]; then
echo "Usage: $0 <videotar URL> [additional parameters to player]" >&2
exit 1
fi
CURL="curl -silent"
URL=$($CURL "$1" | sed -n 's/^.*\(http.*wmv\).*$/\1/p')
WMV=$($CURL "$URL" | sed -n 's/^.*http\(.*wmv\).*$/mmsh\1/p' | head -n 1)
shift
if hash mplayer 2>&-; then
mplayer $WMV $*
else
if hash /Applications/VLC.app/Contents/MacOS/VLC 2>&-; then
/Applications/VLC.app/Contents/MacOS/VLC $WMV $*
else
echo "The URL of the WMV file is $WMV"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment