Skip to content

Instantly share code, notes, and snippets.

@haggaie
Created July 30, 2011 07:37
Show Gist options
  • Save haggaie/1115304 to your computer and use it in GitHub Desktop.
Save haggaie/1115304 to your computer and use it in GitHub Desktop.
Script to record a stream at specific times
#!/bin/sh
if [ "$#" != 4 ] ; then
echo "Usage: $0 <url> <filename> <starttime> <endtime>"
exit 1
fi
URL="$1"
FILENAME="$2"
STARTTIME="$3"
ENDTIME="$4"
at $STARTTIME <<-FIN
#wget "$URL" -O"$FILENAME" &
mplayer "$URL" -vo null -ao null -dumpstream -dumpfile "$FILENAME" &
PID="\$!"
echo kill "\$PID" | at "$ENDTIME"
FIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment