,

yt-dlp

Download video with yt-dlp using format id

yt-dlp -F https://www.youtube.com/watch?v=jABYosi7J14
# or
yt-dlp --list-formats https://www.youtube.com/watch?v=jABYosi7J14

[youtube] Extracting URL: https://www.youtube.com/watch?v=jABYosi7J14
[youtube] jABYosi7J14: Downloading webpage
[youtube] jABYosi7J14: Downloading ios player API JSON
[youtube] jABYosi7J14: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "jABYosi7J14")
[youtube] jABYosi7J14: Downloading m3u8 information
[info] Available formats for jABYosi7J14:
ID      EXT   RESOLUTION FPS CH │   FILESIZE    TBR PROTO │ VCODEC           VBR ACODEC      ABR ASR MORE INFO
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2     mhtml 48x27        0    │                   mhtml │ images                                   storyboard
sb1     mhtml 79x45        0    │                   mhtml │ images                                   storyboard
sb0     mhtml 159x90       0    │                   mhtml │ images                                   storyboard
233     mp4   audio only        │                   m3u8  │ audio only           unknown             [en] Default
234     mp4   audio only        │                   m3u8  │ audio only           unknown             [en] Default
139-drc m4a   audio only      2 │   62.79MiB    49k https │ audio only           mp4a.40.5   49k 22k [en] low, DRC, m4a_dash
249-drc webm  audio only      2 │   62.04MiB    48k https │ audio only           opus        48k 48k [en] low, DRC, webm_dash
250-drc webm  audio only      2 │   81.40MiB    63k https │ audio only           opus        63k 48k [en] low, DRC, webm_dash
139     m4a   audio only      2 │   62.79MiB    49k https │ audio only           mp4a.40.5   49k 22k [en] low, m4a_dash
249     webm  audio only      2 │   61.36MiB    48k https │ audio only           opus        48k 48k [en] low, webm_dash
250     webm  audio only      2 │   80.54MiB    63k https │ audio only           opus        63k 48k [en] low, webm_dash
140-drc m4a   audio only      2 │  166.64MiB   129k https │ audio only           mp4a.40.2  129k 44k [en] medium, DRC, m4a_dash
251-drc webm  audio only      2 │  161.53MiB   126k https │ audio only           opus       126k 48k [en] medium, DRC, webm_dash
140     m4a   audio only      2 │  166.64MiB   129k https │ audio only           mp4a.40.2  129k 44k [en] medium, m4a_dash
251     webm  audio only      2 │  159.46MiB   124k https │ audio only           opus       124k 48k [en] medium, webm_dash
602     mp4   256x144     15    │ ~157.13MiB   122k m3u8  │ vp09.00.10.08   122k video only
269     mp4   256x144     30    │ ~245.49MiB   191k m3u8  │ avc1.4D400C     191k video only
160     mp4   256x144     30    │   91.39MiB    71k https │ avc1.4D400C      71k video only          144p, mp4_dash
603     mp4   256x144     30    │ ~255.96MiB   199k m3u8  │ vp09.00.11.08   199k video only
278     webm  256x144     30    │   89.29MiB    69k https │ vp09.00.11.08    69k video only          144p, webm_dash
229     mp4   426x240     30    │ ~436.17MiB   339k m3u8  │ avc1.4D4015     339k video only
133     mp4   426x240     30    │  207.54MiB   161k https │ avc1.4D4015     161k video only          240p, mp4_dash
604     mp4   426x240     30    │ ~476.65MiB   370k m3u8  │ vp09.00.20.08   370k video only
242     webm  426x240     30    │  153.46MiB   119k https │ vp09.00.20.08   119k video only          240p, webm_dash
230     mp4   640x360     30    │ ~987.69MiB   767k m3u8  │ avc1.4D401E     767k video only
134     mp4   640x360     30    │  419.36MiB   326k https │ avc1.4D401E     326k video only          360p, mp4_dash
18      mp4   640x360     30  2 │  544.69MiB   423k https │ avc1.42001E          mp4a.40.2       44k [en] 360p
605     mp4   640x360     30    │ ~859.52MiB   668k m3u8  │ vp09.00.21.08   668k video only
243     webm  640x360     30    │  267.58MiB   208k https │ vp09.00.21.08   208k video only          360p, webm_dash
231     mp4   854x480     30    │ ~  1.68GiB  1337k m3u8  │ avc1.4D401F    1337k video only
135     mp4   854x480     30    │  781.32MiB   607k https │ avc1.4D401F     607k video only          480p, mp4_dash
606     mp4   854x480     30    │ ~  1.47GiB  1166k m3u8  │ vp09.00.30.08  1166k video only
244     webm  854x480     30    │  449.51MiB   349k https │ vp09.00.30.08   349k video only          480p, webm_dash
22      mp4   1280x720    30  2 │ ≈  1.74GiB  1381k https │ avc1.64001F          mp4a.40.2       44k [en] 720p
136     mp4   1280x720    30    │    1.57GiB  1253k https │ avc1.64001f    1253k video only          720p, mp4_dash
247     webm  1280x720    30    │  822.76MiB   639k https │ vp9             639k video only          720p, webm_dash
311     mp4   1280x720    60    │ ~  5.22GiB  4150k m3u8  │ avc1.640020    4150k video only
298     mp4   1280x720    60    │    2.19GiB  1745k https │ avc1.640020    1745k video only          720p60, mp4_dash
612     mp4   1280x720    60    │ ~  4.87GiB  3872k m3u8  │ vp09.00.40.08  3872k video only
302     webm  1280x720    60    │    1.35GiB  1070k https │ vp09.00.40.08  1070k video only          720p60, webm_dash
312     mp4   1920x1080   60    │ ~  8.55GiB  6805k m3u8  │ avc1.64002A    6805k video only
299     mp4   1920x1080   60    │    4.30GiB  3418k https │ avc1.64002A    3418k video only          1080p60, mp4_dash
617     mp4   1920x1080   60    │ ~  7.55GiB  6008k m3u8  │ vp09.00.41.08  6008k video only
303     webm  1920x1080   60    │    2.28GiB  1813k https │ vp09.00.41.08  1813k video only          1080p60, webm_dash
623     mp4   2560x1440   60    │ ~ 18.09GiB 14393k m3u8  │ vp09.00.50.08 14393k video only
308     webm  2560x1440   60    │    7.95GiB  6326k https │ vp09.00.50.08  6326k video only          1440p60, webm_dash
628     mp4   3840x2160   60    │ ~ 40.07GiB 31879k m3u8  │ vp09.00.51.08 31879k video only
315     webm  3840x2160   60    │   15.42GiB 12265k https │ vp09.00.51.08 12265k video only          2160p60, webm_dash

If the ID should contain other chars than numbers, put it in quotes like -f '251-drc'.

To download a viedeo stream and an audio stream and have it merged into a container format, you can use “+”, as in -f '315+251-drc'. To merge the two streams, use –merge-output-format (as of 2024-05 currently supported formats: avi, flv, mkv, mov, mp4, webm).

Example:

yt-dlp -f '315+251-drc' --merge-output-format mp4 https://www.youtube.com/watch?v=jABYosi7J14


~~DISCUSSION~~