Created
October 14, 2011 20:49
-
-
Save dnet/1288288 to your computer and use it in GitHub Desktop.
MTV videotár player
This file contains 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/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