ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.3k stars 10.03k forks source link

Support downloading YouTube videos with multiple audio tracks #28328

Open mathiasbynens opened 3 years ago

mathiasbynens commented 3 years ago

Checklist

Description

Some YouTube videos have multiple audio tracks. Here’s an example: https://www.youtube.com/watch?v=WaOKSUlf4TM

It would be nice if youtube-dl would download all available audio tracks by default. Separately (but IMHO less importantly), perhaps there should be an option to specify the audio track(s) to download.

pukkandan commented 3 years ago

You can download both audio tracks. Although there is no label as to which is which

$ youtube-dlhttps://www.youtube.com/watch?v=WaOKSUlf4TM -F
youtube-dl is up-to-date (2021.03.03)
[youtube] WaOKSUlf4TM: Downloading webpage
[youtube] WaOKSUlf4TM: Refetching age-gated info webpage
[info] Available formats for WaOKSUlf4TM:
format code  extension  resolution note
249-0        webm       audio only tiny   48k , webm_dash container, opus @ 48k (48000Hz), 877.56KiB
249-1        webm       audio only tiny   49k , webm_dash container, opus @ 49k (48000Hz), 889.24KiB
250-0        webm       audio only tiny   64k , webm_dash container, opus @ 64k (48000Hz), 1.13MiB
250-1        webm       audio only tiny   64k , webm_dash container, opus @ 64k (48000Hz), 1.14MiB
251-0        webm       audio only tiny  127k , webm_dash container, opus @127k (48000Hz), 2.26MiB
251-1        webm       audio only tiny  128k , webm_dash container, opus @128k (48000Hz), 2.27MiB
140-0        m4a        audio only tiny  129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 2.29MiB
140-1        m4a        audio only tiny  129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 2.29MiB
160          mp4        256x144    144p   56k , mp4_dash container, avc1.4d400c@  56k, 30fps, video only, 1.01MiB
394          mp4        256x144    144p   64k , mp4_dash container, av01.0.00M.08@  64k, 30fps, video only, 1.14MiB
278          webm       256x144    144p   78k , webm_dash container, vp9@  78k, 30fps, video only, 1.38MiB
395          mp4        426x240    240p  123k , mp4_dash container, av01.0.00M.08@ 123k, 30fps, video only, 2.18MiB
133          mp4        426x240    240p  123k , mp4_dash container, avc1.4d4015@ 123k, 30fps, video only, 2.18MiB
242          webm       426x240    240p  145k , webm_dash container, vp9@ 145k, 30fps, video only, 2.58MiB
134          mp4        640x360    360p  242k , mp4_dash container, avc1.4d401e@ 242k, 30fps, video only, 4.29MiB
396          mp4        640x360    360p  250k , mp4_dash container, av01.0.01M.08@ 250k, 30fps, video only, 4.43MiB
243          webm       640x360    360p  312k , webm_dash container, vp9@ 312k, 30fps, video only, 5.54MiB
135          mp4        854x480    480p  401k , mp4_dash container, avc1.4d401f@ 401k, 30fps, video only, 7.11MiB
397          mp4        854x480    480p  459k , mp4_dash container, av01.0.04M.08@ 459k, 30fps, video only, 8.13MiB
244          webm       854x480    480p  563k , webm_dash container, vp9@ 563k, 30fps, video only, 9.96MiB
136          mp4        1280x720   720p  677k , mp4_dash container, avc1.4d401f@ 677k, 30fps, video only, 11.98MiB
398          mp4        1280x720   720p  939k , mp4_dash container, av01.0.05M.08@ 939k, 30fps, video only, 16.62MiB
247          webm       1280x720   720p 1111k , webm_dash container, vp9@1111k, 30fps, video only, 19.67MiB
399          mp4        1920x1080  1080p 1698k , mp4_dash container, av01.0.08M.08@1698k, 30fps, video only, 30.05MiB
248          webm       1920x1080  1080p 2016k , webm_dash container, vp9@2016k, 30fps, video only, 35.69MiB
137          mp4        1920x1080  1080p 2249k , mp4_dash container, avc1.640028@2249k, 30fps, video only, 39.80MiB
400          mp4        2560x1440  1440p 4882k , mp4_dash container, av01.0.12M.08@4882k, 30fps, video only, 86.39MiB
271          webm       2560x1440  1440p 5531k , webm_dash container, vp9@5531k, 30fps, video only, 97.87MiB
401          mp4        3840x2160  2160p 9954k , mp4_dash container, av01.0.12M.08@9954k, 30fps, video only, 176.14MiB
313          webm       3840x2160  2160p 13570k , webm_dash container, vp9@13570k, 30fps, video only, 240.13MiB
18           mp4        640x360    360p  582k , avc1.42001E, 30fps, mp4a.40.2 (44100Hz), 10.32MiB
22           mp4        1280x720   720p 2287k , avc1.64001F, 30fps, mp4a.40.2 (44100Hz) (best)
DeathGOD7 commented 2 years ago

You can download both audio tracks. Although there is no label as to which is which

$ youtube-dlhttps://www.youtube.com/watch?v=WaOKSUlf4TM -F
youtube-dl is up-to-date (2021.03.03)
[youtube] WaOKSUlf4TM: Downloading webpage
[youtube] WaOKSUlf4TM: Refetching age-gated info webpage
[info] Available formats for WaOKSUlf4TM:
format code  extension  resolution note
249-0        webm       audio only tiny   48k , webm_dash container, opus @ 48k (48000Hz), 877.56KiB
249-1        webm       audio only tiny   49k , webm_dash container, opus @ 49k (48000Hz), 889.24KiB
250-0        webm       audio only tiny   64k , webm_dash container, opus @ 64k (48000Hz), 1.13MiB
250-1        webm       audio only tiny   64k , webm_dash container, opus @ 64k (48000Hz), 1.14MiB
251-0        webm       audio only tiny  127k , webm_dash container, opus @127k (48000Hz), 2.26MiB
251-1        webm       audio only tiny  128k , webm_dash container, opus @128k (48000Hz), 2.27MiB
140-0        m4a        audio only tiny  129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 2.29MiB
140-1        m4a        audio only tiny  129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 2.29MiB

@mathiasbynens Since the above URL video has 2 audio tracks, there are x-0 and x-1 in audio-only files. So the x-0 is English descriptive and x-1 is English original. So if the video has 7 audio tracks then the naming style will be 0-6 and the number is based on how it's shown on the youtube video page.

See below-attached image for more brief. (English audio track is 0, while Thai audio track is 5). image

I dunno if you can direct download videos with the wanted audio track but you can download audio and video separately and mix them.

Regards, - Death GOD 7 (SE7EN)

VamuveTV commented 1 year ago

Not working when i type on windows youtube-dl https://www.youtube.com/watch?v=nbsZWsUU5sE -F