Skip to content

Instantly share code, notes, and snippets.

@dnet
Created October 14, 2011 20:49
Show Gist options
  • Save dnet/1288288 to your computer and use it in GitHub Desktop.
Save dnet/1288288 to your computer and use it in GitHub Desktop.
MTV videotár player
#!/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 --lines 1)
shift
if hash mplayer 2>&-; then
mplayer $WMV $*
else
if hash vlc 2>&-; then
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