-
-
Save oker1/1289296 to your computer and use it in GitHub Desktop.
MTV videotár player (Mac OS + VLC)
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/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