Skip to content

Your First Download

This chapter was run in the lab, end to end; transcripts t02 and t03 hold the sessions. The film is Big Buck Bunny, the Blender Foundation's open movie, served by the Foundation's own PeerTube instance — freely licensed, and exactly the kind of material yt-dlp is for.

Look first

yt-dlp -F https://video.blender.org/videos/watch/bf1f3fb5-b119-4f9f-9930-8e20e892b898
ID   EXT RESOLUTION FPS |   FILESIZE PROTO | VCODEC  ACODEC
------------------------------------------------------------
240p mp4 240p        24 |   44.37MiB https | unknown unknown
360p mp4 360p        24 |   62.82MiB https | unknown unknown
480p mp4 480p        24 |   74.83MiB https | unknown unknown
720p mp4 720p        24 |  105.78MiB https | unknown unknown

One film, four formats, each a complete MP4 with picture and sound together. (Chapter 5 reads this table properly, including the sites where picture and sound arrive separately.) You will also see a warning in the lab's transcript — Unable to download webpage: HTTP Error 400 — while yt-dlp fetched the film's description. It is benign: the facts yt-dlp needed arrived by another route, and extraction carried on. Warnings are not errors; the run stops for errors.

Download one format

yt-dlp -f 480p \
  -o "downloads/%(title)s [%(id)s].%(ext)s" \
  https://video.blender.org/videos/watch/bf1f3fb5-b119-4f9f-9930-8e20e892b898

-f 480p names the format by the ID in the table's first column. -o is the output template (chapter 6): a folder, the title, the video's ID in brackets, and the extension the format brings with it.

[info] ... Downloading 1 format(s): 480p
[download] Destination: downloads/Big Buck Bunny [bf1f3fb5-b119-4f9f-9930-8e20e892b898].mp4
[download] 100% of   74.83MiB in 00:01:53 at 678.02KiB/s

Check: the file is really what the table promised —

$ ls -la downloads/
-rw-rw---- 1 78466566 Big Buck Bunny [bf1f3fb5-b119-4f9f-9930-8e20e892b898].mp4
$ ffprobe "downloads/Big Buck Bunny [bf1f3fb5-b119-4f9f-9930-8e20e892b898].mp4"
Duration: 00:09:56.57, bitrate: 1052 kb/s
Stream #0:0: Video: h264, yuv420p, 852x480, 24 fps
Stream #0:1: Audio: aac, 48000 Hz, 5.1

74.83 MiB on the table, 78,466,566 bytes on disk; 480p picture and the film's full soundtrack inside. ffprobe (which ships with ffmpeg) is the habit worth forming: it shows what a file is, whatever its name claims.

With no options at all

Plain yt-dlp <URL> also works: it picks the best format on offer and names the file after the title, in the folder you are standing in. That is fine for one file and a poor plan for fifty — the defaults hide the two decisions (which format? what name?) that chapters 5 and 6 exist to make deliberately.