header image
Main Page arrow Published Articles arrow Howto's arrow Howto Download Flash Videos on Linux
Howto Download Flash Videos on Linux PDF Print E-mail
Written by anti-trend   
Jul 31, 2008 at 01:10 PM

ImageWhether it's for a presentation, home multimedia library or just exercising fair use, it's not always practical to stream a video clip that's embedded in a webpage. On the Windows and Mac OS X operating systems, there are a slough of retail applications designed expressly for the purpose of downloading embedded Flash videos from various sites. But what is a Linux user to do when faced with this dilemma? Fortunately, as with most challenges in Linux (and UNIX), the solution is surprisingly simple.

In this example I will be referring to the official Flash player for Linux from Adobe, currently at version 9.0 r124. I'm personally running KDE 3.5.9 on Debian Lenny/Sid with Firefox 3.0.2pre as my browser, but this howto should be fairly agnostic of distro, desktop and browser, and will most likely work with other Flash versions. With that said, if you find any corrections that must be made in relation to other configurations, please contact me and let me know. With that out of the way, on to the good stuff...

In the interest of demonstration, I've chosen a video on YouTube. In my case I've paused the video so it isn't playing, but you can watch the video if you choose to. In either case, the progress bar continues to advance as the file downloads:

YouTube video partially loaded

Once the file reaches 100% (as indicated by the red line reaching completely to the end of the progress bar), I have the complete file. Depending on your browser and its configuration, closing the program may result in your cache being cleared, so leave the window open for now. Start your file browser and navigate to the /tmp directory, like so:

Flash video downloaded to tmp

Here we see a file with a prefix of "Flash" followed by a random 6-character hash. While the filename will be slightly different for every video you download, the prefix will always be the same. In my case, the file ended up being a welter 10.8 MB, but this can vary substantially depending on the length and quality of the video. The important thing here is making sure the video is fully buffered to the hard disk before proceeding with the next step. Otherwise, you might end up with an incomplete video.

Now that we have the full file in our /tmp directory, we can copy it to our home directory (or any location of your choosing). Note that in order to avoid potential issues, it's best to copy the file rather than move it. Once the file is copied, you can simply rename it to something that makes sense to you. For example, "MyVideo.flv". Now you can play the video in your favorite player. This is MPlayer in my case, as it "just works", and plays just about everything under the sun if you have the codecs for it. On Ubuntu (which packages MPlayer in an arguably broken way) and possibly some other distros, you might want to fall back on VLC instead. That is, of course, an exercise which is left to the reader.

Last Updated ( Jun 24, 2009 at 07:43 PM )
Next>