Source

bin / ripvid

Full commit
#!/bin/bash
# Rip the last played FLV.
# Can rip to mp3/flv/whatever extension you give it.

OUT="$@"

if [ -z "$OUT" ]; then
    echo -e "Usage: ripvid <filename.ext>\n"
    exit
fi

pid=`pgrep -f flashplayer | tail -1`
file=`lsof -p $pid | grep '/tmp/Flash' | awk 'END{print "/proc/" $2 "/fd/" $4}' | sed 's/[rwu]$//'`
if [ $file == '/proc//fd/' ]; then
    echo 'No FLV running'
else
    ffmpeg -i $file -ab 320k "$OUT"
fi