You can see YouTube videos everywhere nowadays: on blogs, Google search results, even some news sites. From time to time, you can even manage to find something interesting. This article will show you some Linux tools you can use to save and convert YouTube videos.
clive is video extraction software for Flash content stored on sites like YouTube, Google Video, and Metacafe. The syntax is simple: clive video_url. The application takes the given URL, downloads the FVL file, and converts it into MP4 format by default. One smart way to use clive is to create a text file containing links to videos you want to save and pass it to the program by using a pipe. Use cat video.list | clive and be sure to separate each URL in the file with a new line.
Clive can also re-encode the files into different formats by using FFmpeg. If you want to create an AVI out of the online video in one shot, you can use clive –ffmpeg=”/usr/bin/ffmpeg -y -i %i %o” –reencode=avi video_url. FFmpeg will overwrite output files, use the link as input, and provide an AVI file in the end. Some people prefer to use predefined settings for converting online videos. By editing ~/.clive/config you can make alter the default settings to your liking. A sample config file would look like this:
play_format="avi" # output format path_player="/usr/bin/mplayer %i" # player used path_ffmpeg="/usr/bin/ffmpeg -y %i %o" # encoder used
As you can see, clive can also play files using MPlayer or VLC.
A similar tool is youtube-dl, a script that downloads YouTube videos without converting them. To save an FLV file from a video sharing site, open up a terminal and type youtube-dl followed by a video URL. There’s also a GUI for youtube-dl called YouTube Downloader GUI. It’s a Kommander script that uses KDialog to pop up a window where you can paste a direct link to the online video in order to download it. Another GUI, QtTube, is just as easy to use. Paste the links and it will download the files by using youtube-dl.
If you like GUIs, there’s PyTube, a Python application that downloads the videos, then encodes them by using FFmpeg. PyTube offers a thumbnail preview of the online videos you import and arranges them in a drop-down list. Unfortunately, the list displays the URLs to the videos and not their titles. You can import a whole video list at once and batch convert the videos into one of the available video formats: FLV, AVI, MPG, OGM, animated GIF, MP4, 3GP, and AMV. You can also extract only the audio track of a video file, a feature that might come in handy when you find an interesting music video on YouTube and want to save it as an MP3, Ogg, or WAV file. When converting to video, you can either keep the original size values or specify custom ones to scale the frames.
PyTube is not just about downloading and converting. It can also search YouTube for videos without leaving the application’s GUI and apply effects to the files. PyTube can merge, resize, and rotate videos, insert a different audio track, or generate a ringtone for your cell phone.
UTube Ripper is another software useful utility downloading and converting online videos. It’s written in GTK and has Gambas among its dependencies; be sure to upgrade to the latest Gambas version before using it. You can paste a file in the text field and UTube Ripper will download it for you. Then you can choose whether you want to convert it into another video format or just extract the audio part.
gvdown has both a PyGTK interface and a command-line interface. It presents you with a simple window with a text field where you can input the URL. Press the Download it! button and it will retrieve the file for you.
GNetVideoPlayer is a more complex application. It’s a player and downloader for YouTube and Stage6 videos, and depends on wget, MPlayer, and GtkMediaPlayer. For now, the application is in beta and the interface is available only in Spanish. It displays eight YouTube video previews at a time, allowing you to download the ones you like by accessing the context menu.
If you want to download YouTube videos from KDE, there’s Get YouTube Video, a KDE service menu that you can use with Konqueror. Just right-click onto a Web page that hosts a YouTube video and choose to download it from the context menu.
A nice example of how all these applications work is the Crouse bash script. It makes use of wget to get a file and FFmpeg to convert it. For now, the script works only with direct links (that is, videos with no “feature=related” included in the URL).
Of the above tools, I found clive and PyTube to be the most useful. In less than a year, PyTube morphed from a simple wget front end to a more complex application, but clive is the best at its job. One final note of caution: Because YouTube makes changes in its site from time to time, all of the applications that deal with YouTube videos will likely also need to be updated.