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.
Recently, youtube-dl added video download support for 17 new websites: brightcove.com, auengine.com, RingTV, instagram.com, Jukebox, 3sat, CSpan, Statigr.am, traileraddict.com, hotnewhiphop.com, wat.tv, tu.tv, gamespot.com, tudou.com, Wimp.com, archive.org and break.com
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. It also has supports for user specific playlist downloads, options to add custom or original title to the downloaded video file. proxy support and many more.
Install YouTube-DL in RHEL/CentOS and Fedora
The youtube-dl program can be installed by enabling epel repository under your systems. Once enabled, you can install using ‘yum‘ package manager tool as shown.
# yum install youtube-dl
Update: If you don’t wish to add any third party repository, you can still install it right away using curl or wget command as shown.
# curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl OR # wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
Note: Your system must have curl or wget packages installed to fetch the recent version youtube-dl file. If you don’t have them, you may yum to get it.
After fetching the file, you need to set a executable permission on the script to execute properly.
chmod a+rx /usr/local/bin/youtube-dl
Install YouTube-DL in Ubuntu/Linux Mint and Debian
Ubuntu users can download and install latest youtube-dl version from the webupd8 PPA as shown.
$ sudo add-apt-repository ppa:nilarimogard/webupd8 $ sudo apt-get update $ sudo apt-get install youtube-dl
Update: Similarly, instead using any third party PPA, you can use curl or wget command to install latest version of youtube-dl script as shown.
$ sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl OR sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
After downloading the script, set the executable permission.
$ sudo chmod a+rx /usr/local/bin/youtube-dl
Update YouTube-DL
Youtube-dl itself can be updated to the latest version using the following command.
# youtube-dl -U
Sample Output
Updating to version 2015.09.03 ... Updated youtube-dl. Restart youtube-dl to use the new version.
How to Use YouTube-DL to Download Videos
To 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 https://www.youtube.com/watch?v=iRYvuS9OxdA
Sample Output
[youtube] iRYvuS9OxdA: Downloading webpage [youtube] iRYvuS9OxdA: Downloading video info webpage [youtube] iRYvuS9OxdA: Extracting video information [youtube] iRYvuS9OxdA: Downloading js player new-en_US-vflCeB3p5 [youtube] iRYvuS9OxdA: Downloading DASH manifest [download] Destination: Amy Macdonald - This Is The Life-iRYvuS9OxdA.mp4 [download] 100% of 10.33MiB in 00:01
To list all available formats of video, use option “–list-formats” with the youtube-dl command.
# youtube-dl --list-formats https://www.youtube.com/watch?v=iRYvuS9OxdA
Sample Output
[youtube] vKtwZmhX0lw: Downloading webpage [youtube] vKtwZmhX0lw: Downloading video info webpage [youtube] vKtwZmhX0lw: Extracting video information [youtube] vKtwZmhX0lw: Downloading DASH manifest [youtube] vKtwZmhX0lw: Downloading DASH manifest [info] Available formats for vKtwZmhX0lw: format code extension resolution note 171 webm audio only DASH audio 113k , vorbis@128k (44100Hz), 1.86MiB 140 m4a audio only DASH audio 128k , m4a_dash container, aac @128k (44100Hz), 2.14MiB 141 m4a audio only DASH audio 255k , m4a_dash container, aac @256k (44100Hz), 4.30MiB 278 webm 180x144 DASH video 63k , webm container, vp9, 1fps, video only, 946.76KiB 160 mp4 180x144 DASH video 112k , avc1.4d400c, 15fps, video only, 1.86MiB 242 webm 300x240 DASH video 170k , vp9, 1fps, video only, 2.50MiB 133 mp4 300x240 DASH video 247k , avc1.4d400d, 25fps, video only, 4.11MiB 243 webm 400x320 DASH video 288k , vp9, 1fps, video only, 4.07MiB 13 3gp unknown small 17 3gp 176x144 small , mp4a.40.2, mp4v.20.3 36 3gp 320x240 small , mp4a.40.2, mp4v.20.3 5 flv 400x240 small 43 webm 640x360 medium , vorbis, vp8.0 18 mp4 640x360 medium , mp4a.40.2, avc1.42001E (best)
To download a preferred file format, use the option ‘-f’ (video format code). For example, I would like to download mp4 format, So I use format code as ‘18‘ as shown below.
# youtube-dl -f 18 https://www.youtube.com/watch?v=iRYvuS9OxdA
Sample Output
[youtube] iRYvuS9OxdA: Downloading webpage [youtube] iRYvuS9OxdA: Downloading video info webpage [youtube] iRYvuS9OxdA: Extracting video information [youtube] iRYvuS9OxdA: Downloading DASH manifest [download] Amy Macdonald - This Is The Life-iRYvuS9OxdA.mp4 has already been downloaded [download] 100% of 10.33MiB
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
Type the following command in a terminal to list all the avialable options.
# youtube-dl --help
For other distributions, youtube-dl can be downloaded from the youtube-dl download page.
youtube-dl doesn’t work when the video has age restriction, it doesn’t matter if you put your credentials, not a good tool
I am getting Http Error 429: Too Many Requests
Any solution?
Regards
I get the same thing. Error: YouTube said: This video is unavailable“.
I get the same thing
https://www.youtube.com/watch?v=bqWDLQVpHzk
.@Geroge,
It worked for me, I tried to download
https://www.youtube.com/watch?v=bqWDLQVpHzk
and it worked for me.Hi! I started using youtube-dl for my raspberry pi. It was working fine yesterday (Dec 26th) but every attempt to download a video today returns “Error: YouTube said: This video is unavailable“.
Just update or reinstall again
Can this also download the comments associated with a youtube video?
@Ubaldo,
No, you can’t download the comments of Youtube videos.
I would like to see some comments to determine if this tool is real or if it is malicious software?
I’m using this tool for almost a year and i don’t think its a malicious software.
HD Video Converter Factory is also useful and it’s easier to use.
very nice program it works very well on fedora 27 good job thank u very much
Is there a way to get the current image from a live stream using youtube-dl? If not can you direct me to a command line application that can do this in Linux.
I am trying to capture an image from a live feed every 60 seconds so I can create a timelapse of the day.
Thanks
I often use allavsoft to download all YouTube 1080p videos to 1080p, 720p, 480p, MP4, FLV, AVI, WMV, MKV, MOV, etc.
youtube-dl is pretty slow to start downloading or getting video title only (about 10s) on seagate dockstar, even after decompress.
What should I do to speed it up?
@Skyrail,
I use Youtube-DL everyday to download some videos or extract mp3 songs, but I never seen any slowness, it always fast…
how to play a downloaded video?
@Peter,
Install VLC Player in Linux to play all kind of video formats..
after download that music i suffer from how to execute/open/play that audio so what can i do?
Hi, I’m using Linux Mint for an operating System ! recently I have not been able to download Youtube Video ?? I have tries everything My small brain could come up with & no results ?? Anyone out there have any ideas ? Thanks in advance, Mike
@Mike,
Do you get any errors while running Youtube-DL? could you share with us? so that I can find out the solution for you.
You may try use Allavsoft to download 3sat TV programs, movies and other video clips in batch to your computer, laptop, tablet, mobile phone, iPad, PSP, Zune, X360, Smart TV, etc.
Do we have a limit call when using youtube-dl to request to Youtube. I’m afraid that Google might block me since I request many times.
@Trung,
No any limits applied by YouTube or Google, you can download as many as videos, like I do regularly download videos or mp3 tracks from Youtube without any trouble or issues..
Hi, thank you about this tip. I have a question: How to proceed if there are more than one video on the same url? I’d like to download all the videos, but youtube-dl see only one from the url, for instance this url about Docker self-paced-training course:
https://training.docker.com/self-paced-training
@Gilvan,
Yes, you can download list of videos from specific playlist, just check out the man pages of Youtube-DL here:
i like it a lot!
Nice Tutorial
Thanks a bunch. It was very straight forward using the package. Remain BLESSED!
I cannot dl the youtube-dl at all, what should I do?
@Ali,
May I know what error you getting on the screen while executing youtube-dl command?
Hi there,
I downloaded the file (successfully, I guess, since I didn’t get any error response), but I can’t find it anywhere. Is there a default destination where the files are saved after download?
@Nem,
By default youtube-dl downloads files in the current working directory i.e from where you run the command. If you want to download files to specific location then specify -o switch with location to place download files with youtube url as shown
Don’t use the repositories. Use the curl or wget method. Repositories are outdated.
Works for a lot of sites… https://rg3.github.io/youtube-dl/supportedsites.html
Home website for this program: https://rg3.github.io/youtube-dl/ :) Enjoy!
nice article
“youtube-dl –all-formats ” don’t work anymore as stated! Instead it starts downloading all the formats. Hence, use “youtube-dl –list-formats ” or “youtube-dl -F “. Then choose the format.
@Tanmaya,
Thanks for informing us, we’ve just updated the Youtube-DL article and included new installation instructions and usage of youtube-dl..
Thanks ravi your screenshot screenshot explainationation of how to download youtube-dl was spot on.
Thanks and appreciate you effort being an open source fan myself.
Hi.Ravi. Can I twick this tool to download textbooks or other files?
@Mike,
No way, this tool is used to download files from Youtube only..
For that, wget is a good tool.
How about youtube-dl to download batch youtube links
@Nitin,
We already mentioned about the same in the article, to download a list of video files, create a file with all YouTube links and run the following command to download them.
I am not able to find the downloaded files. where do I get it
@Arun,
I think it saves the downloaded file in current directory…
I had a problem for update:
youtube-dl -U
It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.
….
Ubuntu 14.04 LTS
Memori ram 15,5 GiB
Procer Intel Core i5-4430 CPU @ 3.00GHz x 4
Graphic Gallium 0.4 on NVD9
SO type 64 bits
hard disck 696,5 GB
dual partition with windows 8.1
how to download a series of videos with a single link?????
@ere,
To download a series of videos, create a file and add all the video links that you wish to download.
I have a downlaod that ended up zero sized. When I try to dewnload it again, youtube-dl tells me it’s aready dwonlaoded and gives up. How do I force a download? And where does youtube-dl save it’s setting etc. (I’m using Ububtu 12.04)?
Any thoughts? Thanks.
has this just recently stopped working? Did google/youtube changed something?
All of my old download tools have suddenly stopped working, anyone got any ideas, happened about 1-2weeks ago i think??
dude please provide a link for that wallpaper of yours
@Leme,
I don’t have a link to the wallpaper, sorry I don’t remember from where I get that…
Where can this video files are stored and how to change the default stored location………………THanku
The downloaded vidoes are stored in your current working directory only..
how to resume the youtube link while downloading it in terminal…………
great! its like dos…for me its more fun than click and go…and the commands make sense even though this is my first time. Thanks
Thanks !!!!
I’ve now been using youtube-dl successfully for 2 weeks now, thanks to this tutorial. Thanks for writing it.
how to specify a directory for the file download with youtube-dl
Doesn’t work for Debian after updating repositories..
http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/dists/wheezy/main/source/Sources 404 Not Found
Doesnt work for Kali linux.
sudo add-apt-repository ppa:nilarimogard/webupd8
any suggestion?
A couple of Question –
1. Is there a GUI Client for Windows
2. Can I change the location of stored files , config file.
Between this publication and 12 July 2013, the command-line options have changed. For example, the dash-capital-F “-F” option is no longer present. To fetch all formats for the named URL you now use “–all-formats”. I leave other details to the student.
Also, after you install from the PPA, I had to run the program twice using ‘sudo’ permissions (to enable write into the install location) and with the “–update” option. The program reported as follows:
==========
Hi! We changed distribution method and now youtube-dl needs to update itself one more time.
This will only happen once. Simply press enter to go on. Sorry for the trouble!
From now on, get the binaries from http://rg3.github.io/youtube-dl/download.html, not from the git repository.
==========
I hope these notes save others some confusion.
~~~ 0;-Dan
Thanks, as per your new changes, I’ve modified the article.
Incorrect – incomplete information
It does the trick, but there are loads of options available as extensions / plugins to Firefox / Chrome if you use one of those. The extensions allow you to download video in a couple of clicks – some with format conversion options at the same time if you want. Much quicker and less hassle to use than firing up the terminal and pasting in the url. Just have a browse through the extensions and pick one of those instead…
ClipGrab is better
movgrab is better :)