Skip to content

Instantly share code, notes, and snippets.

@tomka
Forked from anonymous/aljazeera.sh
Created February 21, 2011 14:40
Show Gist options
  • Save tomka/837135 to your computer and use it in GitHub Desktop.
Save tomka/837135 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# Watch Al Jazeera live stream with mplayer. You can specify the
# quality as argument by passing either "low", "high" or "veryhigh"
# to the script. If nothing is given it defaults to "veryhigh".
function printUsage() {
echo "Please pass no arguments or either \"low\", \"high\" or \"veryhigh\". No arguments defaults to \"veryhigh\"."
}
# default quality
PLAYPATH="aljazeera_en_veryhigh"
# test for possible quality parameter
if [ $# -gt 1 ]; then
printUsage
exit 1
elif [ $# -eq 1 ]; then
case $1 in
low)
PLAYPATH="aljazeera_en_low"
;;
high)
PLAYPATH="aljazeera_en_high"
;;
veryhigh)
PLAYPATH="aljazeera_en_veryhigh"
;;
*)
printUsage
exit 1
esac
fi
# Call rtmpdump and mplayer
rtmpdump -v -r rtmp://livestfslivefs.fplive.net/livestfslive-live/ -y "${PLAYPATH}" -a "aljazeeraflashlive-live" -o -| mplayer -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment