How to: Tips and Tricks

Download YouTube videos with youtube-dl

YouTube logoyoutube-dl is a small command-line program to download videos from YouTube.com. It requires the Python interpreter, version 2.x (x being at least 4), and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X.

Install & using

1. install youtube-dl

sudo apt-get update && sudo apt-get install youtube-dl

2. use this command to download files from YouTube

youtube-dl -o [name of output file] [YouTube URL]

3. To view all options youtube-dl, paste this in command line

man youtube-dl

To quit from manual press q key

Examples

1. Download classic flv type and save it as file.flv

youtube-dl -o file.flv "http://www.youtube.com/watch?v=Y54ABqSOScQ"

2. Download Full HD mp4 file and save it as file.mp4

youtube-dl -o file.mp4 -f 37 "http://www.youtube.com/watch?v=Y54ABqSOScQ"

This table from Wikipedia may be useful

Comparison of YouTube media types

Comparison of YouTube media types (Wikipedia)

youtube-dl: http://bitbucket.org/rg3/youtube-dl/wiki/Home

  • Thank you for the “Download YouTube videos with youtube-dl” post

  • An explanation about the installation for other platforms is needed and it is not clear whether the downloaded file is higher quality or if it is converted.

  • @Luis all that information are in the post.. You’re able to choose video format you want.. flv or mp4 720px or 1080p.. look at the table and examples ;)

  • Man thanks its very helpfull only thing i want is pause option but anyways its amazing to download by terminal !! thnx

  • where will the output file be stored on the harddisk

  • files are stored in your working directory. But you can choose where will be the file stored eg:
    youtube-dl -o /new/store/directory/video.mp4 http://youtube.com/

  • It would be very useful to me if you could write down the procedure of download bytes-ranges via youtube-dl

  • Excellent!

  • Thank you for these instructions, really helpful!! I always use acethinker video downloader to save YouTube videos, It is a free cloud based software to download videos without install any software in your device, even works for 1080p youtube videos.