youtube-dl is a Python based small command-line tool that allows to download videos from
YouTube.com, Dailymotion, Google Video, Photobucket, Facebook, Yahoo, Metacafe, Depositfiles and few more similar sites. It written in pygtk and requires Python interpreter to run this program, it’s not platform restricted. It should run on any Unix, Windows or in Mac OS X based systems.
youtube-dl also allows to choose specific avialable video quality format to download or let the program itself automatically download higher quality video from the site.
YouTube-DL InstallationOpen your terminal and run:
# wget http://youtube-dl.org/downloads/2013.02.02/youtube-dl -O /usr/local/bin/youtube-dl
# chmod a+x /usr/local/bin/youtube-dl
If you receive any certificate related error, try with the option '
--no-check-certificate'.
Note: If you receive an error like:
SyntaxError: invalid syntax.
Update 'python' to latest version
How to Use YouTube-DL to Download VideosTo download a video file, simply run the following command. Where “VIDEO_URL” is the url of the video that you want to download.
# youtube-dl http://www.youtube.com/watch?v=8qY3LoDP7Ew
[youtube] Setting language
[youtube] 8qY3LoDP7Ew: Downloading webpage
[youtube] 8qY3LoDP7Ew: Downloading video info webpage
[youtube] 8qY3LoDP7Ew: Extracting video information
[download] Destination: Akcent Love Stoned 2013( Official Music Video ) LYRICS.flv-8qY3LoDP7Ew.mp4
[download] 100% of 12.23MiB in 00:01
To download a video in availabe file formats, use option "--all-formats" with the command.
# youtube-dl http://www.youtube.com/watch?v=8qY3LoDP7Ew
[youtube] Setting language
[youtube] 8qY3LoDP7Ew: Downloading webpage
[youtube] 8qY3LoDP7Ew: Downloading video info webpage
[youtube] 8qY3LoDP7Ew: Extracting video information
Available formats:
37 : mp4 [1080x1920]
46 : webm [1080x1920]
22 : mp4 [720x1280]
45 : webm [720x1280]
35 : flv [480x854]
44 : webm [480x854]
34 : flv [360x640]
18 : mp4 [360x640]
43 : webm [360x640]
5 : flv [240x400]
17 : mp4 [144x176]
To download a preferred file format, use the option '-f' (video format code). For example, I would like to download flv format, So I use format code as '34' as shown below.
# youtube-dl -f 34 http://www.youtube.com/watch?v=8qY3LoDP7Ew
[youtube] Setting language
[youtube] 8qY3LoDP7Ew: Downloading webpage
[youtube] 8qY3LoDP7Ew: Downloading video info webpage
[youtube] 8qY3LoDP7Ew: Extracting video information
[download] Destination: Akcent Love Stoned 2013( Official Music Video ) LYRICS.flv-8qY3LoDP7Ew.flv
[download] 100% of 12.23MiB in 00:01
To download a
list of video files, create a file and place all the YouTube links that you wish to download.
# youtube-dl -a youtube_links.txt
That's it. Now enjoy downloading your favourite videos.