#!/bin/sh

if [ $# -eq 0 ]; then
 echo "Usage: ./getlaunch.sh VIDEOID (<BANDWIDTH>) "
 echo " videoid = Lauch Video ID"
 echo " bandwidth = 56,128,300 (default 300)"
 echo "Example:"
 echo " ./getlaunch.sh 2152289"
 exit 0
fi

videoid=$1
shift

if [ $1 -eq ""]; then
# 56 or 128 or 300
 bandwidth=300
else
 bandwidth=$1
 shift
fi

file1=$(wget "http://launchtoday.launch.yahoo.com/player/medialog.asp?vid=$videoid&cid=1&pid=4&csid=396500550&p1=&p2=&p3=2&bw=$bandwidth&mf=1&origin=35&pguid=AA388C059C7849D99CCFBC72B6F51E37&uid=42&sk=bad551cd352143eb2da02&z=ms.asx"  -q -O -)
file2=$(wget "$file1" -q -O -)

#echo "$file2"
./mimms "$file2" -o $videoid.wmv

