Viewing YouTube movies offline

Video On the Go

Author(s):

With the right tools, you can store YouTube movies on your hard disk and view them when Internet access is unsatisfactory or unavailable.

The drawback of movies on the web is that they are only available for online viewing. For many reasons, you might want to download a movie – perhaps because your connection is not good enough for smooth playback, or you want to archive a video, or you want to view it where you won't have Internet access. Several small programs can download web movies – and sometimes even convert them to another format.

Programs such as 4K Video Downloader, cclive, ClipGrab, get-flash-videos, Minitube, xVideoServiceThief, and youtube-dl can help (but see the "Warning" box). These tools appear to YouTube like a normal user, which allows you to save the streaming output to a file on your hard disk.

Warning

Respect copyrighted material: You cannot download just any video without considering your actions and then use it for any purpose. If in doubt, ask the movie creator for permission.

4K Video Downloader, ClipGrab, Minitube, and xVideoServiceThief offer graphical user interfaces. In contrast, cclive, get-flash-videos, and youtube-dl are programs for the command line, meaning a tougher learning curve while you learn the cryptic parameters. On the upside, however, you can embed the tools in shell scripts. A quick overview of the most important functions is provided in Table 1.

Table 1

Candidates

 

4K Video Downloader

cclive

ClipGrab

 

http://www.4kdownload.com/

http://cclive.sourceforge.net

http://clipgrab.org

License

Closed source

GPLv3/AGPLv3

GPLv3

Version

3.0

v0.7.16

3.3.0.1

Interface

GUI

Command line

GUI

Format selection

Yes

Yes

Yes

Format conversion

No

No

Yes

Pause download

Yes

Yes

Cancel only

Resume download

No

Yes

No

Timer-controlled download

No

No

No

Download playlist

Yes (max. 25 movies)

No

No

Tap channels

Yes (max. 25 movies)

No

No

Export subtitles

Yes (max. 25 items)

No

No

Extract soundtrack

Yes

No

Yes

Proxy server

No

Yes

Yes

Save

Freely selectable file name

Freely selectable file name

Freely selectable file name

Table 1

Candidates (continued)

 

get-flash-videos

Minitube

xVideoServiceThief

youtube-dl

 

http://code.google.com/p/get-flash-videos/

http://flavio.tordini.org/minitube

http://xviservicethief.sourceforge.net

http://rg3.github.io/youtube-dl/download.html

License

Apache License 2.0

GPLv3

GPLv3

Unlicensed (public domain)

Version

1.24

2.1.2

2.5

2013.11.20

Interface

Command line

GUI

GUI

Command line

Format selection

Limited

Limited

No

Yes

Format conversion

No

No

No

No

Pause download

No

Cancel only

Yes

Yes

Resume download

No

No

No

Yes

Timer-controlled download

No

No

Yes

No

Download playlist

No

No

No

Yes

Tap channels

No

No

No

No

Export subtitles

No

No

No

Yes

Extract soundtrack

No

No

No

No

Proxy server

No

No

Yes

No

Save

Freely selectable file name

Freely selectable directory

Freely selectable directory

Limited selection of file name

Apart from ClipGrab and Minitube, all the applications require the URL for the desired movie, which can be obtained by navigating to the movie on YouTube in your browser and copying the address from the address bar. Once you get this far, you might alternatively opt for a web-based solution (see "Outside the Box").

4K Video Downloader

Although Open Media LLC advertises 4K Video Downloader as an open source product, it exists only as a binary package for Ubuntu [1]. Users of other distributions can try the portable packages offered on the download page: These tarballs contain all the libraries needed by the program. You only need to unpack the archive and run the 4kvideodownloader.sh script.

When launched, the tool comes up with a clearly arranged main window (Figure 1). To download a movie, copy the URL for the movie to the clipboard and press Paste Url in the 4K Video Downloader toolbar, then enter a file name in a new window, choose the format, and set the compression method.

Figure 1: 4K Video Downloader is easy to use but comes with annoying advertising.

On request, the program extracts only the soundtrack and saves any existing subtitles. If you are downloading multiple movies, enter the desired video format via Smart Mode before doing so in the settings. 4K Video Downloader displays the volume of data already downloaded and the remaining time. After downloading, choose Play from the context menu to play back the movie in your desktop environment's default movie player.

If necessary, you can pause the download and continue later. The downloaded files still remain on the hard disk if you remove the entry in the main window of the application via the context menu. 4K Video Downloader repeatedly displays annoying ads for the full version, which lets you download an unlimited number of videos from playlists and channels and store an unlimited number of movies and subtitles. In contrast, the free version only handles 25 movies or subtitles.

cclive

The console tool cclive [2] is included in almost all major distributions; installation is thus a simple matter with the package manager. On openSUSE, the tool resides in the Packman repository. You can usually expect the stable version, 0.7, which is released under the GPLv2. The developer version 0.9, on the other hand, uses the AGPLv3. Besides the license, the two versions differ mainly under the hood.

To download a movie, simply pass the URL of the movie to the program in quotes. During the download, the tool shows the progress in terms of the volume of downloaded data, the remaining time, and the current data rate. If you want to download in a specific format, query the existing formats first with -S (Figure 2). The program then returns a list of cryptic identifiers; the overview on the web will help you interpret them [3]. To specify the desired format, use -s:

Figure 2: Cclive uses very cryptic commands; however, the tool is very useful for scripting.
$ cclive -s fmt17_144p "http://www.youtube.com/watch?v=YE7VzlLtp-4"

With additional parameters, you can pass in an explicit proxy server or modify the details for the user agent. By default, the program pretends to be Mozilla/5.0. Cclive restarts aborted downloads at a later time. On request, it starts another program directly after downloading. You can use this ability, for example, to integrate FFmpeg for data conversion.

If you don't like the file name chosen automatically by the program, you can change the structure. The --filename-format %t.%s option tells cclive to compose the file name from the title and the suffix, as in bigbuckbunny.mp4. Alternatively, simply specify your choice of name using the -o parameter. The program does not accept complete channels or playlists as a source, and it can't extract audio tracks.

ClipGrab

To launch ClipGrab, download the tool from the web page [4], unzip the package, make the file that starts with clipgrab executable, and then launch the program. In the test, the program ran under Ubuntu, openSUSE, and Arch Linux – but only on 32-bit systems. It refused to work on 64-bit Ubuntu. If you like, you can have a look at the source code; the program itself is released under the GPLv3.

The main window has several tabs that you have to go through once from left to right (Figure 3). The first tab lets you search YouTube; thus, there is no need to identify the URL of the video you want to download in your browser. However, the search returns extremely few hits: For Big Buck Bunny, ClipGrab found just eight videos, not even including the official film by the Blender Foundation.

Figure 3: ClipGrab searching for videos. Clicking on a match tells the program to use its address for the download.

If you fail to find the movie you want with the built-in search, type the URL manually in the Downloads tab, then set the appropriate format. If YouTube does not provide this itself, ClipGrab converts the video with FFmpeg. Although the application lets you cancel a download, it lacks the ability to continue it later.

During the download, the tool only displays the progress. As with cclive, the ClipGrab settings allow you to specify a proxy server. The program can extract sound tracks.

get-flash-videos

Ubuntu users will find the get-flash-videos Perl script in their distribution's repositories; for others, it is available from the homepage [5]. The version numbering of the tool, which is released under the Apache License 2.0, is quite confusing; the documentation is also partially obsolete. As with cclive, you only enter the URL for the movie; the -p parameter specifies the file name:

$ get_flash_videos -p bbb.mp4 http://www.youtube.com/watch?v=YE7VzlLtp-4

The program does not provide a feature for selecting a format; it only supports one of three vague types high, medium, and low. On the other hand, the script lets you play back the movie, even while downloading, with a freely selectable player. This is the complete feature scope, and in our lab, the program refused to download any movies (Figure 4).

Figure 4: Get-flash-videos did not want to download the video for Big Buck Bunny, whereas its competitors had no problem doing so.

Minitube

The Minitube movie player plays YouTube videos on your desktop and downloads the stream into a file on request. Unlike the versions for Windows and Mac OS X, the Linux version is available for free; the source code is released under the GPLv3; however, the makers do push you for a donation [6].

On Ubuntu, you can install Minitube via the package manager; users of other distributions, however, need to grab the source code and compile the program themselves. In the package manager, first install the development packages for Qt version 4.5 and Phonon. On openSUSE, these packages live in the libqt4-devel and phonon-devel packages. After unpacking the archive with the source code, call qmake && make and then launch the program with ./build/target/minitube.

Whereas the version that ships with Ubuntu 2.0 will download any video from YouTube, the current 2.1.2 version only downloads movies that are explicitly marked with a Creative Commons license. In the main window of Minitube, enter the title of the video. After clicking on Watch, the tool presents all matches in the left sidebar (Figure 5). A click on the preview starts the movie playing in the right-hand side of the window.

Figure 5: Minitube is a player for YouTube movies, as well as a downloader.

A somewhat inconspicuous button in the lower right-hand corner lets you select a different resolution. To download the movie you are currently viewing, just select Video | Download. You have no control over the file name or the format of the movie. The program shows its progress when you click on the easily overlooked Downloads in the lower right corner of the window. You also have the option of stopping the download process and pressing Change location to select an alternative location for the movie; otherwise, all movies end up in the ~/Videos directory.

The program offers the option of restarting an interrupted download but not of continuing the download. During the download, Minitube shows the progress, the file size of the movie, how many megabytes it has downloaded, the data rate, and the time remaining.

xVideoServiceThief

Getting started with xVideoServiceThief, alias xVST, is a fairly unusual process: First, you install Qt 5.0 and FFmpeg via the package manager. Then, you download the Compressed Package from the website [7], unpack the archive on your hard disk, and start the install.sh script, which dumps the application in the ~/xVideoServiceThief directory. You can then call the xvst program.

The program is licensed under the GPLv3. The makers, however, do ask for donations on the website and in the program. The main window summarizes all the settings and functions (Figure 6). At the bottom, you enter the directory in which you will be saving the movies; then click the Add video button, type the URL of the desired movie, and watch while the software goes about its work. For every download, the tool displays the progress, the remaining time, the speed, and the file size. The software lets users pause the process at any time and continue later, although users cannot decide the file name for the downloaded movies themselves. Additionally, the program arbitrarily decides in which format it will fetch the video from YouTube. It does not support channels and playlists, and it does not download subtitles.

Figure 6: xVST has many useful functions in its settings.

xVST hides other interesting features in its settings: You can set the address of a proxy server and other parameters, if so desired. It leaves encoding to FFmpeg but keeps the original file on request. The program also includes a function for scheduled downloads. It was the only test candidate to update itself automatically. After completing an update, however, it quits without a prompt.

youtube-dl

The classic youtube-dl [8], written in Python, is under active development – and at a very fast pace. If you cannot find the tool in your distribution's repositories, you can install the current version with the commands from Listing 1. To use the program, you only need to pass it a URL, and off you go.

Listing 1

Installing youtube-dl

$ sudo wget https://yt-dl.org/downloads/2013.11.20/youtube-dl -O /usr/local/bin/youtube-dl
$ sudo chmod a+x /usr/local/bin/youtube-dl

The online help, which you can view by typing youtube-dl --help, exposes the program as a functional monster: Using appropriate parameters, you can set up a download via a proxy server or change the string for the user agent. Youtube-dl downloads playlists completely or partially on request. For partial downloads, you either specify the number of videos, use regular expressions to select movies with a specific song, or to specify a date. The program cannot tap complete channels. On request, the script reduces the data rate, thus considerably saving network bandwidth.

Youtube-dl saves metadata, video descriptions, and subtitles in separate files on request. However, the software does not provide an option for defining the file name of the movies that you save. Like cclive, it only lets you specify parts of the name using wildcards. For example, the following command would save the MP4 video titled Big Buck Bunny in the ~/Videos as Big Buck Bunny.mp4:

$ youtube-dl -o '~/Videos/%(title)s.%(ext)s' http://www.youtube.com/watch?v=YE7VzlLtp-4

During the download, the script reveals the progress, the file size of the entire movie, the data rate, and the time remaining. Broken downloads can be continued later if needed. The program even automatically detects whether a canceled download exists and it then revives the process.

Youtube-dl can simultaneously download a movie in all formats offered by YouTube. If you are interested in only a particular format, you can first list the available formats (Figure 7). When starting the script, then enter the appropriate identification number. You even have the option of specifying preferences. If you need to log in to access a movie, the program helps you do so. It will also forward downloaded movies to another application, such as FFmpeg, on request.

Figure 7: Here, youtube-dl initially tries to download the video with a resolution of 144x176 pixels. If that does not work, it resorts to the version with a resolution of 240x320 pixels.

Conclusions

If you want an easy option for downloading a YouTube movie, you should go for a program with a graphical user interface. The 4K Video Downloader is very easy to handle but comes with annoying advertising and half-crippled functions.

ClipGrab launches quickly on 32-bit systems, but the search feature proved useless in our lab. Minitube plays the video but only downloads videos with a Creative Commons license in the current version. xVideoServiceThief is recommended for anybody who typically downloads many videos overnight.

In terms of command-line programs, youtube-dl's large feature set and update frequency speak in favor of this tool. Hot on its heels follows cclive, which offers very similar functions. Get-flash-videos failed to download any movies at all, at least in the version we tested (1.24), and is thus disqualified.

Thinking Outside the Box

In addition to the applications presented here, you can find numerous other download helpers. The Firefox add-on Video DownloadHelper [9] adds a new menu item to the browser with buttons that let you download the YouTube video you are currently viewing (Figure 8). You have the choice between formats provided by the platform, and the extension will even convert video to other formats after downloading, if so desired. Thus, Video DownloadHelper is ideal for users who often browse YouTube.

Figure 8: Video DownloadHelper even breaks into the YouTube site and offers its services there.

If you only occasionally download a video, the easiest way is to leave it up to a service on the Internet. For example, on the Clip Converters page [10], simply enter the URL for the video, choose a format and file name, and then download the movie (Figure 9).

Figure 9: Clip Converter converts the video to the desired format.

The Author

Tim Schürmann is a freelance computer scientist and author. Besides books, Tim has published various articles in magazines and on websites.