#!/bin/sh # Downloads a video stream from ruutu.fi to stdout using # rtmpdump(-yle). The first parameter is the rtmp URL, the second # parameter is the video page URL, the optional third parameter is the # output file. RTMPDUMP= which rtmpdump > /dev/null 2>&1 if [ $? = 0 ]; then RTMPDUMP=rtmpdump else which rtmpdump-yle > /dev/null 2>&1 if [ $? = 0 ]; then RTMPDUMP=rtmpdump-yle fi fi if [ "x$RTMPDUMP" = "x" ]; then echo "ERROR: neither rtmpdump nor rtmpdump-yle on \$PATH" 1>&2 exit 1 fi if [ "x$1" = "x" ]; then echo "Expected rtmp URL as parameter" 1>&2 exit 1 fi if [ "x$2" = "x" ]; then echo "Expected ruutu.fi video page URL as parameter" 1>&2 exit 1 fi OUTFILE="$3" if [ "x$OUTFILE" = "x" ]; then OUTFILE=- fi $RTMPDUMP -q -r "$1" -W http://n.sestatic.fi/sites/all/modules/media/Nelonen_mediaplayer_static_latest.swf -p "$2" -o "$OUTFILE" exit $?