Downloading Videos (Flash)

Kevin Lin
Have you ever been frustrated with watching videos online? They take ages to load, most websites are full of annoying advertisements, and you have to be on their website to watch it. In this article I will be telling you ways to download most online videos and also convert them! (for both Windows XP and Ubuntu).

Downloadhelper

A tool that both Ubuntu and Windows support is downloadhelper. It is a plugin for firefox that detects if a video file is streaming on the current page, and then allows you to save the file. You need to have firefox installed on your computer.

  1. Using firefox you install the plugin by going to http://www.downloadhelper.net/install.php and clicking the add to firefox button. Finish the installation by restarting firefox

  2. Goto the web page with the video file you want, but can't download. You will notice after restarting that there is a new icon on your firefox toolbar that looks like 3 circles. This is the downloadhelper icon. Play the video until the downloadhelper icon turns colored and spins

  3. Then, click the arrow next to the icon and choose the file that is playing (if there is more than 1 video streaming then there may be more than one option). The firefox download manager will open and you can save the video file just like any other file. Keep in mind that the downloaded file may be ".flv" which isn't playable on many computers or portable devices (a good media player to use if you want to play flv files is VLC media player http://www.videolan.org/vlc/).

If the file is .flv what we should do is convert the file to a .avi file or .mp4 so that it's easier to

watch and share. Fortunately, downloadhelper can convert the file automatically for you. All you do is instead of just clicking on the file at step 3, hover over it with your mouse and a menu will pop out at the side. Click "Download & Convert" and select the file format you want the output to be. Wait for the download to finish... and now you can play your video offline without having to wait for buffering or have distracting ads pop up! This works with many sites such as youtube and youku.

Youtube-dl

Youtube is a great source for all sorts of videos. So many people use it that I'm dedicating a section of this article to show a method to download youtube videos a lot faster than in the above example. While downloadhelper is a great tool, it is rather cumbersome to have to play the video and jump through so many hoops to save and convert a file. Since I use youtube so much I have a script that I run to automate the process. All I have to do is put in a link! This involves using the command line, so it's not as user friendly, but it's a lot faster. What I use is a script called youtube-dl which downloads youtube videos in the flv format. It needs a python interpreter to run.

Ubuntu

I use Ubuntu 9.04 and this setup works perfectly for me. After installing youtube-dl and ffmpeg, you will be able to convert and save youtube videos from the command line.

  1. Install youtube-dl by opening up Terminal (Applications → Accessories → Terminal) and typing in sudo apt-get install youtube-dl then pressing enter.

  2. Since python is already installed on Ubuntu we can test youtube-dl right now by typing in youtube-dl http://www.youtube.comthen pressing enter (remember to replace http://www.youtube.com with a youtube link). Youtube-dl is very powerful since it can also download playlists, which lets you download a lot of videos at almost no effort

  3. Now that we can download the videos, we need a way to convert the videos to a format that we want it in. We're going to use ffmpeg to do this. Install ffmpeg by typing in sudo apt-get install ffmpeg.

  4. The basic syntax of ffmpeg is ffmpeg -i input_file output_file. Remember to include the extension that you want the file to be at the end of output_file. An example is example.avi. The command ffmpeg -i input.flv output.avi would convert input.flv to an avi file and save it as output.avi. There's a lot more you can do with ffmpeg, this is just the absolute basic thing.

  5. Now that we have all the pieces, we just have to put the parts together. I'll provide 2 simple scripts, one to download a youtube video and convert it to an avi file, and a script that downloads the video then extracts the audio and saves it as a mp3 file (I use this 1 a lot). What it does is it downloads the video to the directory you're currently in, names it tmp.flv, then converts and removes it. So make sure that there isn't a file named tmp.flv in your directory that you want.

Avi Download:

#!/bin/bash

echo Whats the youtube link?

read youtube_link

echo Final output filename?

read output_name

youtube-dl $youtube_link -o tmp.flv

echo $output_name

ffmpeg -i tmp.flv "$output_name".avi

rm tmp.avi

Mp3 Download:

#!/bin/bash

echo Whats the youtube link?

read youtube_link

echo Final output filename?

read output_name

youtube-dl $youtube_link -o tmp.flv

ffmpeg -i tmp.flv -f mp3 -vn -acodec copy "$output_name".mp3

rm tmp.avi

To use these scripts just copy and paste the script into a text editor, and save it as something like YoutubeAvi.sh. Then, goto where you saved the script by using the cd command in terminal, and type in bash script_name (such as YoutubeAvi.sh). Follow the prompts from the terminal and enjoy!

To comment, please sign in to your Yahoo! account, or sign up for a new account.