Youtube-dl: Tips that you might not know

Tools to download videos from YouTube there are quite a few. Windows, Android, iPhone and Blackberry users can download tubemate for free and users of GNU / Linux We know that one of the best tools (if not the best) to download videos from YouTube it is precisely youtube-dl, an application that we run through the terminal.

youtube-dl

Although we have already talked about this tool on other occasions, this time I bring you some tips that you may not have known. So let's get started.

How to use youtube-dl?

Of course, the first thing is to know how to use this tool, which is found in most of the distributions. Its basic use would be:

$ youtube-dl https://www.youtube.com/watch?v=higI04jG6R8

But beware (and here comes the first detail) not only works with YouTube, it has extensive list of sites from which we can download videos, including adult sites.

To update this tool once installed, we can use the command:

$youtube-dl -U

Of course, if we install from the repositories it is possible that we get this poster:

It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.

We can also download the videos in all available formats that it has, for this we use the –all-format option:

$ youtube-dl --all-formats https://www.youtube.com/watch?v=higI04jG6R8

If we want to download only the video in a specific format, we use the –format option:

$ youtube-dl --format 46 https://www.youtube.com/watch?v=higI04jG6R8

Where the number we put varies according to the format and size of the video, for example:

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]

We can also download a list of videos, for this we just put them in a text document and execute:

$ youtube-dl -a enlaces.txt

If we use a proxy server, we can download videos with the –proxy URL parameter:

$ youtube-dl --format 46 --proxy http://192.168.0.1:3128 https://www.youtube.com/watch?v=higI04jG6R8

Here are some of the options that may be of interest:

GLASS OPTIONS
-i : When there are download errors, for example, the video that is not available in a playlist skips.
--abort-on-error : Abort downloading more videos (in playlist or command line) if error occurs
--dump-user-agent : show current browser id
--user-agent UA : specify a custom user agent
--no-check-certificate : Suppresses HTTPS certificate validation.
--playlist-start NUMBER : Download a playlist, starts at number 1 by default.
--playlist-end NUMBER : Download a playlist, starts the last number by default.
--min-filesize SIZE : Do not download any video smaller than the SIZE value (for example 50k or 44.6m)
--max-filesize SIZE : Do not download any video larger than the SIZE value (for example 50k or 44.6m)
--date DATE : Download videos only uploaded on a certain date.
--datebefore DATE : Download videos before or on a certain date.
--dateafter DATE : Download videos after or on a certain date.
--min-views COUNT : Do not download the videos with less than X number of visits seen
--max-views COUNT : Do not download videos with more than X number of visits seen
--rate-limit LIMIT : Limit the maximum download speed in bytes per second (for example, 50K or 4.2M)
--retries RETRIES : Number of retries (default is 10)

And as always, you can find many more options if you open a terminal and put:

$ man youtube-dl

Well if you don't want to use Youybe-dl, you can get more information about TubeMate, or some other similar application, for Android there are many more that do the same 😀


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Gregory Swords said

    Can youtube-dl download 1080p videos from YouTube again?

    1.    elav said

      Try the options and tell me 😀

      1.    Gregory Swords said

        Buuu, if what I don't want is to try it hahaha, ok ok, as soon as I can I'll check it.

        1.    elav said

          Hahaha .. Vagrancy Level 10

          1.    Gregory Swords said

            No, youtube-dl still can't download 1080p videos (with audio) from YouTube, and the truth is, I'm very lazy to do what Rayonant mentions.

            For 1080p YouTube videos I will continue to use Clipgrab (recommended by namesake Yoyo308), and for 720p videos and so on, I will use youtube-dl as usual.

        2.    Rayonant said

          As far as I know it can, but you have to download the video and the audio and then the script will join them with ffmpeg or avconv, take a look here http://www.webupd8.org/2014/02/video-downloader-youtube-dl-gets.html at least it works for me, although I have not tried it except in a video.

  2.   vicky said

    Another good option is Clipgrab

    1.    elav said

      I didn't know him .. Searching ...

    2.    eliotime3000 said

      I tested it and it is available for Windows.

  3.   eliotime3000 said

    Will there be a front-end for youtube-dl?

    1.    n0hear said

      I made a youtube-dl frontEnd days ago, I did it in Ruby and GTK +, I leave you a video where I show the installation of the script and its operation 🙂 http://youtu.be/_OTnGz49If0 regards

        1.    orange said

          sudo add-apt-repository ppa: nilarimogard / webupd8
          sudo apt-get update
          sudo apt-get install youtube-dlg

          if it fails> apt-get -f install

          erase 😀

      1.    eliotime3000 said

        Interesting. I will test it on my PC with Debian

  4.   kerameki said

    Excuse my ignorance but I honestly didn't know about this tool and it worked perfectly for me, great! Thanks elav (and all the people at DesdeLinux) because every time I enter I learn something!!!

  5.   Omar said

    I use Clipgrab, before that I used YouTube but I don't know why it stopped working.

  6.   Omar said

    Orale, good that it works again, before it was the only one I used, but it stopped working I don't know why and I started using Clipgrab very good too. Cheers

  7.   Warheart said

    Perhaps it is only necessary to mention that to see the available download options it is done with -F, which includes the possibility of downloading only audio and / or only video.

  8.   vinsuk said

    Co @ # $% ^ &, these tips should be considered more, they are incredibly useful: -B

  9.   Akira kazama said

    Excellent program, although I use it with youtube-dl-gui to make it easier to use:

    https://github.com/MrS0m30n3/youtube-dl-gui

  10.   porter said

    Very good

  11.   illukki said

    Good tips! I used one to download the best audio quality because the first download the sound was very bad. Now I don't remember what the option is, something of -quality, and I don't have it installed here.
    A query if I list the txt for the sound, I assume that it downloads it anyway, right?
    Greetings.

  12.   Adolfo Rojas G. said

    Waw, I did not know about the multi-format to download on youtube-dl, it's great.

  13.   darkguzz said

    What a good contribution is youtube-dl, but I take the opportunity to ask the author (elav), or the community of readers about streaming videos, normally these videos are in parts in extension .ts accompanied by .m3u8, the difficult thing is to download them I have tried with example: avconv -i "http://hotasp.v.cntv.cn/asp/hls/main/0303000a/3/default/bdb4f9c2818646c3bbcc5898b257b6ed/main.m3u8" -c copy -bsf: a aac_adtstoasc out.mkv
    But it always gives me an error (non monotonically increasing dts to muxer in stream 1: 187221> = 187200) and the download is canceled, so far the only thing I have been able to do is watch the entire video and once they have loaded let's say: the 100_parts.ts, download all the parts and join them with: cat * .ts> video_ts_unidos.mkv
    Note: avconv (it's the new version of ffmpeg) 。。。。。 HELP! PLEASE!

  14.   orange said

    Why do you delete my comments if they are contributions?

    1.    elav said

      We did not delete your orange comments, they simply had not been approved. welcome to DesdeLinux 😉

      1.    error said

        ok sorry: D, thank you ..

  15.   Ugo Yak said

    Hello elav, the post is very useful, and I would like to comment on the following detail, in case you are interested.

    When trying to download a list of videos using the text file, the format that should be used is:

    youtube-dl –no-playlist -a links.txt

    Otherwise it will try to download the entire playlist from the site (sooooo many videos!)
    Note: in the text file it is enough to locate each URL in a different line for it to read them correctly.

    regards

  16.   Matias said

    Does anyone know if it can be downloaded in .mp3 format? I mean, only the audio of the videos. Thank you

    1.    Alen said

      Yes, it is the photo number 141, but it is not in mp3 it is another audio format, but with a converter you convert it easily

  17.   eliotime3000 said

    And by the way, youtube-dl is available on Windows.

  18.   pandev92 said

    Good tool, although I want to remember that you can use plugins for our favorite browsers, such as chromium or firefox, as desktop programs jdownloader allows downloading as well. 🙂

  19.   Miguel Angel said

    The utilities from the folks at 4kdownload.com are very good too. Although it seems that there are only packages for Ubuntu, if you download the versions that say 'portable' and unzip, you always have a ".sh" with which to launch the program. From Fedora it works great for me. In the case of video downloads, the graphical environment itself indicates all the available formats and qualities.
    Youtube-dl I have used it whenever the DownLoadHelper addnons failed me.

  20.   asrafil said

    From where can I get the list of format numbers?

  21.   static said

    It would be good if you check the new youtube-dl updates, it is now possible to download by adding the URL between "single quotes".

    Example:

    [statick @ AcerV5 Videos] $ youtube-dl -f mp4 «https://www.youtube.com/watch?feature=player_embedded&v=so08FLD4Ck4»

    regards

  22.   Bern said

    To all mothers the option to download a playlist.

  23.   Moses said

    Hello, this program freezes my machine after it does not let me download any video, I mean: (youtube.dl) can download some more in others I get an error message and it happens to me as with windows when the messages appear too many times and Even closing the error windows the machine freezes me. Could you tell me what would be the cause or what command can help me. From now on. Thanks a thousand.

  24.   sebastian said

    I bought a raspberry pi and the truth is that I only used it to play, could I use it to download PLAYLISTS from youtube?

  25.   davidchobits said

    Very good article. I found it by looking for advanced youtube-dl options, specifically the format selection.
    Greetings and forward !!

  26.   Marta said

    And how do I download a part of the video, instead of downloading it in its entirety that starts at minute 1:03 and ends at 1:13, for example.

  27.   Vicente said

    Although this article is already a few years old, I would recommend Newpipe, free software suitable for "Google-free" devices:
    https://newpipe.schabi.org/

    Greetings.

  28.   Ale said

    Hello!! Do you know if it can download video segments, instead of the full video? I can't find anywhere any tool, or website with which you can download a clipping of a YT video. Before there was YTcutter, but it has not worked for about 6 months. . . If anyone knows of a solution other than cutting it out at your store, let me know please! Thank you!!