Download youtube video directly from the command line with youtube-dl

2010-05-03 366 words 2 mins read

If you keep searching for applications to <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="">download the <a class="zem_slink freebase/en/youtube" title="YouTube" rel="homepage" href="">youtube videos or you keep searching for the firefox addons to download the embedded the video, then this is for you. Ofcouse that is the case, only if you do not want to copy it after you have watched it in the <a class="zem_slink freebase/en/web_browser" title="Web browser" rel="wikipedia" href="">browser :). If you have already watched it then you can copy it from the <a class="zem_slink freebase/en/mozilla_firefox" title="Firefox" rel="homepage" href="">Firefox cache. I will post on that later for now lets see youtube-dl.

Lets download it first:

<a class="zem_slink freebase/en/sudo" title="Sudo" rel="homepage" href="">sudo yum install youtube-dl

Now when you want to download a video then all you need to do is

youtube-dl <a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="">URL

This will work only if you can watch without logging in to your account, if you need to <a class="zem_slink freebase/guid/9202a8c04000641f80000000055d5879" title="Login" rel="wikipedia" href="">login then you should provide your <a class="zem_slink freebase/en/user" title="User (computing)" rel="wikipedia" href="">username and <a class="zem_slink freebase/en/password" title="Password" rel="wikipedia" href="">password, like so:

youtube-dl -u username -p password URL

The problem with this is that the file will be saved with not so useful name. If you want to save the file with appropriate name then you can save the file with the title name:

youtube-dl -t URL

There are few other options worth looking at, specially :

-f FMT, –format=FMT
video format code
-b, –best-quality  download the best quality video possible
-m, –mobile-version
alias for -f 17
-d, –high-def      alias for -f 22

If you have multiple url&#8217;s to download then place all the url&#8217;s in a file, and then use the command:

youtube-dl -a filename

Hope this is useful to you.<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="">Ask OnSoftware: Downloading HD video from YouTube ( <li class="zemanta-article-ul-li"><a href="">Bulk Youtube Video Downloader For Firefox ( <li class="zemanta-article-ul-li"><a href="">Megavideo Time Limit Bypass ( <li class="zemanta-article-ul-li"><a href="">Convert Youtube Videos To MP3 ( <li class="zemanta-article-ul-li"><a href="">At Last! The Forgotten YouTube Video Downloader. ( <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href=""><img class="zemanta-pixie-img" src="" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it