This works only on Unix.
- Get youtube-dl
- List the formats for the video with
youtube-dl --list-formats <url>
You'll get an output like
[youtube] h3--ed9sOQo: Downloading webpage
[youtube] h3--ed9sOQo: Downloading m3u8 information
[youtube] h3--ed9sOQo: Downloading MPD manifest
[info] Available formats for h3--ed9sOQo:
format code extension resolution note
91 mp4 256x144 HLS 197k , avc1.42c00b, 30.0fps, mp4a.40.5@ 48k
92 mp4 426x240 HLS 338k , avc1.4d4015, 30.0fps, mp4a.40.5@ 48k
93 mp4 640x360 HLS 829k , avc1.4d401e, 30.0fps, mp4a.40.2@128k
94 mp4 854x480 HLS 1380k , avc1.4d401f, 30.0fps, mp4a.40.2@128k
95 mp4 1280x720 HLS 2593k , avc1.4d401f, 30.0fps, mp4a.40.2@256k (best)
- Download the video directly with
youtube-dl -f <format code> <url>
For example,
youtube-dl -f 95 https://www.youtube.com/watch\?v\=h3--ed9sOQo
- The process will run until you decide to halt it with
Ctrl+c
, and will save an.mp4
file with the name of the video in the current directory.
- You can change the output name with the
---output <filename>
flag. For example,
youtube-dl -f 95 --output myvideo.mp4 https://www.youtube.com/watch\?v\=h3--ed9sOQo