Created
July 30, 2011 07:37
-
-
Save haggaie/1115304 to your computer and use it in GitHub Desktop.
Script to record a stream at specific times
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 | |
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