banner



How To Download Multiple Links At Once

In this comprehensive Youtube-dl tutorial, we are going to learn what is Youtube-dl and the list of about commonly used Youtube-dl commands with examples to download audio and video streams from Internet in Linux operating systems.

What is Youtube-dl?

Youtube-dl is a most popular command line YouTube downloader application. Youtube-dl tin can be able to download a single track or the unabridged playlist in one go.

Youtube-dl is not only to download videos from Youtube, simply also from a lot of other websites. You lot can view the complete list of supported sites here.

Information technology is a free and open source plan written in Python. It supports GNU/Linux, Mac OS X and Microsoft Windows.

1. Install Youtube-dl On Linux

Youtube-dl tin can exist installed in many ways. Let us them all.

The officially recommended way to install Youtube-dl is but download information technology, save it in your $PATH, get in executable and start using it correct away.

$ sudo curl -50 https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

If yous don't accept curl, use wget instead:

$ sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
$ sudo chmod a+rx /usr/local/bin/youtube-dl

1.ii. Install Youtube-dl using Pip

Alternatively, you lot can install information technology using Pip as shown below.

$ sudo -H pip install --upgrade youtube-dl

i.three. Install Youtube-dl using package manager

Youtube-dl is also available in the official repositories of some Linux distributions.

To install Youtube-dl in Alpine Linux, run:

$ sudo apk add together youtube-dl

Install Youtube-dl in Arch Linux, EndeavourOS, Manjaro Linux using command:

$ sudo pacman -S youtube-dl

On Debian, Ubuntu, Linux mint, Pop_OS!:

$ sudo apt install youtube-dl

On Fedora:

$ sudo dnf install youtube-dl

On openSUSE:

$ sudo zypper install youtube-dl

1.4. Install FFmpeg on Linux

Youtube-dl depends on FFmpeg to download 720p videos from YouTube and catechumen videos to other formats. To install FFmpeg on Linux, refer the following guide.

  • How to install FFmpeg on Linux

one.5. Update Youtube-dl

If you lot've manually installed Youtube-dl using curl or wget, run the post-obit command to update it:

$ sudo youtube-dl -U

If you installed it using pip, practice:

$ sudo pip install -U youtube-dl

Those who installed Youtube-dl using the distribution's packet director, just use the advisable update command. For example, on Arch Linux, you tin update Youtube-dl by simply running the post-obit control:

$ sudo pacman -Syu

On Debian, Ubuntu:

$ sudo apt update

Now, let u.s.a. see some examples to learn to utilise Youtube-dl.

2. Youtube-dl Tutorial With Examples

Here, I take compiled most commonly used Youtube-dl commands to download a video or playlist from YouTube.

2.1. Download video or playlist

To download a video or the entire playlist from YouTube, just mention the URL like below:

$ youtube-dl https://www.youtube.com/sentry?5=7E-cwdnsiow

If you want to download video or playlist with a custom name of your choice, the command would be:

$ youtube-dl -o 'abdul kalam inspirational speech' https://www.youtube.com/picket?5=7E-cwdnsiow

Supercede "abdul kalam inspirational speech communication" with your ain proper noun.

Exercise you want to salve the video in some other location? Use -o flag followed by the target location like below.

$ youtube-dl -o '~/Downloads/abdul kalam speech communication' https://www.youtube.com/watch?five=7E-cwdnsiow

Here I am downloading the video to the Downloads directory.

[youtube] 7E-cwdnsiow: Downloading webpage [download] Destination: /abode/sk/Downloads/abdul kalam voice communication.f271 [download] 100% of 111.86MiB in 01:00 [download] Destination: /abode/sk/Downloads/abdul kalam voice communication.f251 [download] 100% of 6.12MiB in 00:03 [ffmpeg] Merging formats into          "/home/sk/Downloads/abdul kalam spoken communication.webm"          Deleting original file /home/sk/Downloads/abdul kalam speech.f271 (pass -k to keep) Deleting original file /home/sk/Downloads/abdul kalam oral communication.f251 (pass -yard to proceed)

You tin can also include additional details,  such as the title, the uploader name (aqueduct name) and upload engagement etc., in the file name past using the post-obit command:

$ youtube-dl -o '%(championship)s by %(uploader)s on %(upload_date)south in %(playlist)s.%(ext)south' https://www.youtube.com/watch?v=7E-cwdnsiow

2.2. Download multiple videos

Sometimes, you might want to download multiple videos from or any other site. If then, but mention the URL of the videos with space-separated similar below:

$ youtube-dl <url1> <url2>

Alternatively, you can put them all in a text file and laissez passer it to Youtube-dl as an statement like below.

$ youtube-dl -a url.txt

This command will download all videos mentioned in the url.txt file.

2.3. Download audio-simply from a video

Youtube-dl allows us to download sound only from a YouTube video. If you e'er been in a situation to download merely the audio, run:

$ youtube-dl -10 https://www.youtube.com/lookout man?v=7E-cwdnsiow

By default, Youtube-dl will save the audio in Ogg (opus) format.

If you prefer to download whatsoever other formats, for case mp3 , run:

$ youtube-dl -ten --audio-format mp3 https://www.youtube.com/watch?v=7E-cwdnsiow

This command will download the audio from the given video/playlist, convert it to an MP3 and save it in the current directory. Delight notation that you lot should install either ffmpeg or avconv to catechumen the file to mp3 format.

2.4. Download video with description, metadata, annotations, subtitles and thumbnail

To download a video forth with its other details such every bit description, metadata, annotations, subtitles, and thumbnail etc., use the following command:

$ youtube-dl --write-description --write-info-json --write-annotations --write-sub --write-thumbnail https://www.youtube.com/watch?v=7E-cwdnsiow

2.five. List all available formats of video or playlist

To list all available formats that a video or playlist is bachelor in, use the following command:

$ youtube-dl --list-formats https://www.youtube.com/watch?v=7E-cwdnsiow

Or,

$ youtube-dl -F https://world wide web.youtube.com/watch?five=7E-cwdnsiow

Sample output:

List all available formats of a youtube video using youtube-dl
List all available formats of a YouTube video using youtube-dl

As you can see in the in a higher place screenshot, Youtube-dl lists all available formats of the given video. From left to right, information technology displays the video format code, extension and resolution notation of the corresponding video. This tin be helpful when you lot desire to download a video at a specific quality or format.

two.6. Display the size of Youtube videos

To retrieve the file size of a video, use -F flag.

$ youtube-dl -F https://www.youtube.com/watch?v=7E-cwdnsiow

You will run into the file size at the end of each file.

Sample output:

[youtube] 7E-cwdnsiow: Downloading webpage [info] Available formats for 7E-cwdnsiow: format code  extension  resolution annotation 249          webm       audio merely tiny   51k , opus @ 50k (48000Hz), 2.56MiB 250          webm       audio only tiny   68k , opus @ 70k (48000Hz), iii.23MiB 140          m4a        sound simply tiny  128k , m4a_dash container, [email protected] (44100Hz), seven.59MiB 251          webm       audio but tiny  137k , opus @160k (48000Hz), 6.12MiB 160          mp4        192x144    144p   52k , avc1.4d400c, 30fps, video only, 1.71MiB 278          webm       192x144    144p   73k , webm container, vp9, 30fps, video only, 3.73MiB 133          mp4        320x240    240p   89k , avc1.4d400d, 30fps, video just, 3.12MiB 242          webm       320x240    240p  135k , vp9, 30fps, video just, 6.06MiB 134          mp4        480x360    360p  215k , avc1.4d401e, 30fps, video simply, 7.53MiB 243          webm       480x360    360p  242k , vp9, 30fps, video only, 10.39MiB 135          mp4        640x480    480p  382k , avc1.4d401e, 30fps, video only, 14.13MiB 244          webm       640x480    480p  390k , vp9, 30fps, video only, xvi.44MiB 136          mp4        960x720    720p  737k , avc1.4d401f, 30fps, video only, 26.99MiB 247          webm       960x720    720p  770k , vp9, 30fps, video only, 31.12MiB 137          mp4        1440x1080  1080p 1391k , avc1.640028, 30fps, video only, 46.50MiB 248          webm       1440x1080  1080p 1421k , vp9, 30fps, video only, 52.19MiB 271          webm       1920x1440  1440p 3462k , vp9, 30fps, video only, 111.86MiB eighteen           mp4        480x360    360p  360k , avc1.42001E, [e-mail protected] 96k (44100Hz), 21.55MiB 22           mp4        960x720    720p  578k , avc1.64001F, [email protected] (44100Hz) (all-time)

2.vii. Download videos in sure quality and/or format

By default, Youtube-dl will download the all-time available quality video. However, it is besides possible to download a video or playlist at a specific quality or format.

YouTube is capable of downloading videos in the following qualities:

  • best - Select the best quality format of the given file with video and audio.
  • worst - Select the worst quality format (both video and audio).
  • bestvideo - Select the best quality video-only format (e.thou. DASH video). Please note that it may non be bachelor.
  • worstvideo - Select the worst quality video-only format. May not be available.
  • bestaudio - Select the best quality audio but-format. May not be bachelor.
  • worstaudio - Select the worst quality audio only-format. May non be available.

For example, if you want to download best quality format (both audio and video), just use the following control:

$ youtube-dl -f best https://www.youtube.com/watch?v=7E-cwdnsiow

Similarly, to download audio-only with best quality:

$ youtube-dl -f bestaudio https://www.youtube.com/scout?five=7E-cwdnsiow

To download worst quality video-only format, use the following control:

$ youtube-dl -f worstvideo https://world wide web.youtube.com/watch?v=7E-cwdnsiow

Y'all can also combine dissimilar format options like below.

$ youtube-dl -f bestvideo+bestaudio https://www.youtube.com/watch?v=7E-cwdnsiow

The in a higher place command will download best quality video-merely and best quality audio-only formats and merge them together with ffmpeg or avconv. Make sure you have installed any ane of these tools on your system.

If you don't desire to merge, replace + (plus) operator with , (comma) similar below:

$ youtube-dl -f 'bestvideo,bestaudio' https://world wide web.youtube.com/watch?v=7E-cwdnsiow -o '%(championship)south.f%(format_id)s.%(ext)southward'

This command will download best quality video and best quality audio and will non mix them. In this instance, you lot volition get two files, one is sound and some other is video. In this example, an output template ( -o choice) is recommended as bestvideo and bestaudio may have the same file name.

We tin can even download a video or playlist at a specific quality with specific resolution.

For instance, the following command volition download the best quality video in 480 pixel resolution (less than or equal to 480p).

$ youtube-dl -f "all-time[pinnacle<=480]" https://www.youtube.com/lookout man?v=7E-cwdnsiow

Like already said, nosotros tin can group the format selectors to become a specific quality video. The post-obit command will download best format available(both audio and video) but no meliorate than 480p.

$ youtube-dl -f 'bestvideo[height<=480]+bestaudio/best[height<=480]' https://www.youtube.com/watch?five=7E-cwdnsiow

2.8. Download videos using format lawmaking

All videos have format codes which we tin can employ to download a video at specific quality.

To find the format code, just list the available formats using any one of the following commands:

$ youtube-dl --list-formats https://world wide web.youtube.com/watch?v=7E-cwdnsiow

Or

$ youtube-dl -F https://www.youtube.com/watch?five=7E-cwdnsiow
List all available formats with youtube-dl
List all available formats with youtube-dl

As yous can see in the to a higher place screenshot, all format codes of the given video are listed in the commencement column. The best quality format is given at the end (the format code is 22 ). So, the control to download all-time quality format is:

$ youtube-dl -f 22 https://www.youtube.com/watch?v=7E-cwdnsiow

Some videos may not accept the same formats available while you download videos from playlist. In such cases, you lot can specify multiple format codes in any preferred gild of your option. Accept a wait at the post-obit instance:

$ youtube-dl -f 22/17/18 <playlist_url>

Equally per the above instance, Youtube-dl will download the videos in format 22 if it is available.

If the format 22 is not available, it will and so download format 17 if it is available.

If both 22 and 17 formats are not available, it will finally endeavor to download format 18.

If none of the specified formats are available, Youtube-dl will complain that no suitable formats are available for download.

Please note that that slash is left-associative, i.due east. formats on the left hand side are preferred.

ii.9. Download videos by file extension

Download video(s) in your preferred format, say for example MP4, just run:

$ youtube-dl --format mp4 https://world wide web.youtube.com/watch?v=7E-cwdnsiow

Or,

$ youtube-dl -f mp4 https://www.youtube.com/watch?v=7E-cwdnsiow

Like I already mentioned in the previous section, some videos may not available in your preferred formats. In such cases, Youtube-dl volition download any other all-time available formats.

For instance, the post-obit control will download best quality MP4 format file. If MP4 format is not available, then it will download any other all-time available format.

$  youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/all-time[ext=mp4]/best' https://world wide web.youtube.com/watch?five=7E-cwdnsiow

If you desire to download them with custom filename, practice:

$ youtube-dl -f mp4 -o                      '%(title)s.f%(format_id)south.%(ext)southward'                    https://www.youtube.com/watch?v=7E-cwdnsiow

2.x. Fix size limit for videos

When you download multiple videos from a playlist, you might want to download videos within a sure size merely.

For example, this command will not download any videos smaller than the given size, say 100MB:

$ youtube-dl --min-filesize 100M <playlist_url>

If you don't want to download videos larger than the given size, exercise:

$ youtube-dl --max-filesize 100M <playlist_url>

We tin also combine format selection operators to download certain size videos.

The post-obit command will download best video-merely format simply not bigger than 100 MB.

$ youtube-dl -f 'all-time[filesize<100M]' https://www.youtube.com/sentry?5=7E-cwdnsiow

2.11. Download videos past date-wise

Youtube-dl allows us to filter and download video or playlist by their upload engagement. This will be very helpful when you desire to download videos from a playlist that contains 100s of videos.

For case, to download videos uploaded at an exact date, for example October 01, 2018, the control would exist:

$ youtube-dl --appointment 20181001 <URL>

Download videos uploaded on or before a specific date:

$ youtube-dl --datebefore 20180101 <URL>

Download videos uploaded on or afterward a specific engagement:

$ youtube-dl --dateafter 20180101 <URL>

Download only the videos uploaded in the final 6 months:

$ youtube-dl --dateafter at present-6months <URL>

To download videos between a specific date, for example January 01, 2018 to January 01, 2019, use the following command:

$ youtube-dl --dateafter 20180101 --datebefore 20190101 <URL>

2.12. Download specific videos from playlist

This is yet another useful feature of Youtube-dl. It allows the states to download a specific song(s) from a playlist that contains 100s of songs.

For example, to download the 10th file from a playlist, run:

$ youtube-dl --playlist-items 10 <playlist_url>

You tin also download and catechumen the file to other format at the same time. For the the following command volition download the 1st file from the playlist and convert information technology to .mp3 format:

$ youtube-dl --playlist-items i -x --audio-format mp3 <playlist_url>

Similarly, to download multiple random files, just specify indices of the videos in the playlist separated by commas like below::

$ youtube-dl --playlist-items 2,3,7,x <playlist_url>

You can also specify the range of songs. To download a video playlist starting from a certain video, say 10, to finish:

$ youtube-dl --playlist-beginning 10 <playlist_url>

To download only the files starting from 2nd to 5th in a playlist, apply:

$ youtube-dl --playlist-start 2 --playlist-end 5 <playlist_url>

ii.13. Download only videos suitable for specific age

This is another notable feature of Youtube-dl. It allows usa to download only videos suitable for the given historic period.

Say for example, to download all "Let's Play" videos that aren't marked "NSFW" or age-restricted for 7 year-olds from a playlist, run:

$ youtube-dl --lucifer-title "let'south play" --age-limit 7 --reject-title "nsfw" <playlist_url>

2.14. Ready download speed limit

You can utilise -r option to limit the speed. For example, the post-obit command will limit the speed to 50K .

$ youtube-dl -r 50K <URL>

Note that speed is specified in bytes per 2d.

2.xv. Resume downloads

Past default, youtube-dl will automatically resume the download where you left it off. If it is doesn't resume the download for whatever reason, but force the resume of partially downloaded files with -c, --go along flag:

$ youtube-dl  -c  <URL>

2.16. Display Youtube-dl help

Youtube-dl has a lot more than options. I guess these examples are merely enough to utilise Youtube-dl to download videos from online. For more details, refer Youtube-dl assist department.

$ youtube-dl --help

3. Youtube-dl Troubleshooting

Here are some common errors that yous might meet from fourth dimension to time. Most errors will go fixed themselves after updating the youtube-dl to its well-nigh contempo version.

Nevertheless, a few errors like below volition not get stock-still even if you're using an updated youtube-dl version.

3.one. Fix "Unable to download video information: HTTP Mistake 403: Forbidden" Error

When downloading videos from YouTube, sometimes y'all will go an error like below.

Error: unable to download video data: HTTP Error 403: Forbidden

To set this error, refer the following guide.

  • How To Gear up "Unable to download video data: HTTP Mistake 403: Forbidden" Error

3.2. Alert: Requested formats are incompatible for merge and will exist merged into mkv

This is some other common mistake. When you download a video, yous will get an error like below:

[youtube] _XEgknKEBws: Downloading webpage                      WARNING: Requested formats are incompatible for merge and will be merged into mkv.                    Error: unable to open for writing: [Errno 36] File name too long: '\xe0\xae\xa8\xe0\xaf\x8b\xe0\xae\xaf\xe0\xaf\x8d \xe0\xae\x8e\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xb0\xe0\xaf\x8d\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xaf\x81 \xe0\xae\x9a\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xaf\xe0\xaf\x88 \xe0\xae\x85\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\x95\xe0\xae\xb0\xe0\xae\xbf\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\x95\xe0\xaf\x81\xe0\xae\xae\xe0\xaf\x8d \xe0\xae\x87\xe0\xae\xaf\xe0\xae\xb1\xe0\xaf\x8d\xe0\xae\x95\xe0\xaf\x88 \xe0\xae\xaa\xe0\xae\xbe\xe0\xae\xa9\xe0\xae\x95\xe0\xae\xae\xe0\xaf\x8d - \xe0\xae\xa8\xe0\xae\xbe\xe0\xae\xae\xe0\xaf\x87 \xe0\xae\xa4\xe0\xae\xaf\xe0\xae\xbe\xe0\xae\xb0\xe0\xae\xbf\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\xa4\xe0\xaf\x81 \xe0\xae\x8e\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\x9f\xe0\xae\xbf- \xe0\xae\xae\xe0\xae\xb0\xe0\xaf\x81\xe0\xae\xa4\xe0\xaf\x8d\xe0\xae\xa4\xe0\xaf\x81\xe0\xae\xb5\xe0\xae\xb0\xe0\xaf\x8d \xe0\xae\xa4\xe0\xaf\x80\xe0\xae\xaa\xe0\xae\xbe \xe0\xae\xb5\xe0\xae\xbf\xe0\xae\xb3\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\x95\xe0\xae\xae\xe0\xaf\x8d-_XEgknKEBws.f136.mp4.role'

This is actually not a problem simply an expected beliefs for youtube-dl.

Past default, youtube-dl volition download the highest quality audio and the highest quality video streams available then join them into a uniform container like mkv, mp4 etc.

If these audio and video streams doesn't fit well in an mp4 container, youtube-dl will then pack them in mkv container and brandish the above warning message.

In such cases, you tin can ignore the mkv alert and download the best quality video and the best quality sound but merely in an mp4 container past explicitly mentioning the desired best quality audio and video formats like below:

$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' https://youtu.exist/_XEgknKEBws

3.3. ERROR: unable to open for writing: [Errno 36] File name likewise long

When you try to download a YouTube video that has long name, you will probably get this error:

[youtube] _XEgknKEBws: Downloading webpage                      ERROR: unable to open up for writing: [Errno 36] File name too long:                    '\xe0\xae\xa8\xe0\xaf\x8b\xe0\xae\xaf\xe0\xaf\x8d \xe0\xae\x8e\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xb0\xe0\xaf\x8d\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xaf\x81 \xe0\xae\x9a\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xaf\xe0\xaf\x88 \xe0\xae\x85\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\x95\xe0\xae\xb0\xe0\xae\xbf\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\x95\xe0\xaf\x81\xe0\xae\xae\xe0\xaf\x8d \xe0\xae\x87\xe0\xae\xaf\xe0\xae\xb1\xe0\xaf\x8d\xe0\xae\x95\xe0\xaf\x88 \xe0\xae\xaa\xe0\xae\xbe\xe0\xae\xa9\xe0\xae\x95\xe0\xae\xae\xe0\xaf\x8d - \xe0\xae\xa8\xe0\xae\xbe\xe0\xae\xae\xe0\xaf\x87 \xe0\xae\xa4\xe0\xae\xaf\xe0\xae\xbe\xe0\xae\xb0\xe0\xae\xbf\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\xa4\xe0\xaf\x81 \xe0\xae\x8e\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\x9f\xe0\xae\xbf- \xe0\xae\xae\xe0\xae\xb0\xe0\xaf\x81\xe0\xae\xa4\xe0\xaf\x8d\xe0\xae\xa4\xe0\xaf\x81\xe0\xae\xb5\xe0\xae\xb0\xe0\xaf\x8d \xe0\xae\xa4\xe0\xaf\x80\xe0\xae\xaa\xe0\xae\xbe \xe0\xae\xb5\xe0\xae\xbf\xe0\xae\xb3\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\x95\xe0\xae\xae\xe0\xaf\x8d-_XEgknKEBws.f136.mp4.function

To fix this error, merely download the video with shorter name of your choice with "-o" flag like below:

$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'                      -o video.mp4                    https://youtu.be/_XEgknKEBws

Conclusion

In my stance, Youtube-dl is undoubtedly one of the best downloader to download audio, video from online. You can use Youtube-dl to download audio and video from hundreds of websites.

I will keep updating this Youtube-dl tutorial when I came beyond a new Youtube-dl tip. Bookmark and proceed visiting it once in a while.

If you think some of import tip is missing, delight let me know in the comment department beneath. I will check and update this guide accordingly.

Resources:

  • Youtube-dl website
  • https://jonlabelle.com/snippets/view/shell/youtube-dl-command

Source: https://ostechnix.com/youtube-dl-tutorial-with-examples-for-beginners/

Posted by: freelsject1971.blogspot.com

0 Response to "How To Download Multiple Links At Once"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel