ExplodingPenguin.TV Linux Love, Microsoft Frustrations, and Other Geekery


Play Flash Video in VLC, and Save, after Flash 10.2 update in Linux

The Adobe Flash player, in Linux, used to save the flv file in the /tmp directory while the video was still open. That made it easy to copy or play the file in another video player, which was useful since the flash player in Linux can often go a little awry, especially in full screen mode. When flash player updated to 10.2, the temporary directory for flash changed as well. Getting control of the file again is easy.

Enter this in the terminal:

sudo gedit /usr/local/bin/yt


Copy the following script into the text editor:


FLASH_TMP=`ls /tmp | grep Flash*`

if [[ $FLASH_TMP ]]; then
     vlc /tmp/Flash*
     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\)$/'; }
          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\)$/'; }

     vlc $(flashvids)


Click save

Make the file you just created executable:

sudo chmod +x /usr/local/bin/yt


Now you can create a custom launcher and point it to the /usr/local/bin/yt. And all you have to do is click that launcher to play the video in VLC.

If you want to copy the file to more perminent location just create follow th steps appove, using a different file name. And change the lines that read:

vlc /tmp/Flash*

vlc $(flashvids)



cp /tmp/Flash* Videos/

cp $(flashvids) Videos/


Running this script will copy the video to your Videos folder.

Filed under: Linux Desktop No Comments