Skip to content

Instantly share code, notes, and snippets.

@zuloo
Created March 6, 2016 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuloo/91585d271bbdc6a9bbd9 to your computer and use it in GitHub Desktop.
Save zuloo/91585d271bbdc6a9bbd9 to your computer and use it in GitHub Desktop.
play flash viedeo in vlc
#!/bin/bash
FLASH_TMP=`ls /tmp | grep Flash*`
if [[ $FLASH_TMP ]]; then
vlc /tmp/Flash*
else
if [[ `ps x | awk '/libgcflashplayer.so\ /{print $1}'` ]]; then
flashvids() { lsof -p `ps x | awk '/libgcflashplayer.so\ /{print $1}'` -n 2>/dev/null | perl -lne '@F = split(/ +/, $_, 9); print "/proc/$F[1]/fd/${\($F[3] =~ /(^\d+)/)[0]}" if $F[4] eq "REG" && $F[8] =~ /\(deleted\)$/'; }
else
flashvids() { lsof -p `ps x | awk '/libflashplayer.so\ /{print $1}'` -n 2>/dev/null | perl -lne '@F = split(/ +/, $_, 9); print "/proc/$F[1]/fd/${\($F[3] =~ /(^\d+)/)[0]}" if $F[4] eq "REG" && $F[8] =~ /\(deleted\)$/'; }
fi
vlc $(flashvids)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment