Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support downloading YouTube videos with multiple audio tracks #32862

Open
1 of 3 tasks
mahaveergautamji opened this issue Jul 20, 2024 · 7 comments
Open
1 of 3 tasks

Support downloading YouTube videos with multiple audio tracks #32862

mahaveergautamji opened this issue Jul 20, 2024 · 7 comments
Labels

Comments

@mahaveergautamji
Copy link

mahaveergautamji commented Jul 20, 2024

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

how to downloa dmultiple audio tracks from youtube

WRITE QUESTION HERE
image

@dirkf
Copy link
Contributor

dirkf commented Jul 20, 2024

First use -F to list the available formats; then specify the desired audio format in the download command.

@dirkf
Copy link
Contributor

dirkf commented Jul 21, 2024

@mahaveergautamji ?

@mahaveergautamji
Copy link
Author

mahaveergautamji commented Jul 22, 2024

i used that command but how i can download a selected track like japaness or hindi pls give instructions

@dirkf
Copy link
Contributor

dirkf commented Jul 22, 2024

The instructions assume that you've read the Manual, especially the concerning the -F and -f options, and also Format Selection.

If the language of the tracks is not clear from the format listing, you would have to guess. As always, post a full verbose text log of any command that doesn't seem to be doing what you expect from the documentation.

@aiur-adept
Copy link
Contributor

@mahaveergautamji the audio tracks are labelled in the -F output with their 2-letter language code. For example:

python3 -m youtube_dl -F https://www.youtube.com/w
atch\?v\=HwAPLk_sQ3w
[youtube] HwAPLk_sQ3w: Downloading webpage
[info] Available formats for HwAPLk_sQ3w:
format code  extension  resolution note
249-0        webm       audio only [fil] audio_quality_low   47k , webm_dash container, opus  (48000Hz
), 8.88MiB
249-1        webm       audio only [de] audio_quality_low   49k , webm_dash container, opus  (48000Hz)
, 9.11MiB
249-2        webm       audio only [ar] audio_quality_low   49k , webm_dash container, opus  (48000Hz)
, 9.14MiB
249-3        webm       audio only [ru] audio_quality_low   49k , webm_dash container, opus  (48000Hz)
, 9.15MiB
249-4        webm       audio only [pl] audio_quality_low   49k , webm_dash container, opus  (48000Hz)
, 9.16MiB
249-5        webm       audio only [es] audio_quality_low   49k , webm_dash container, opus  (48000Hz)
, 9.20MiB
249-6        webm       audio only [zh] audio_quality_low   49k , webm_dash container, opus  (48000Hz)
, 9.21MiB
249-7        webm       audio only [fr] audio_quality_low   50k , webm_dash container, opus  (48000Hz)
, 9.21MiB
249-8        webm       audio only [uk] audio_qual...

However, it doesn't seem there is a way to get the video with a specific language track as audio - all the video options will be "video only", so you will have to download the audio you want and then post-process to combine it with the video (I think ffmpeg can combine audio and video).

@dirkf
Copy link
Contributor

dirkf commented Jul 28, 2024

Formats labelled video-only have no audio language by definition. They may possibly have burned-in subtitles that imply a specific language: it depends on the site and extractor as to whether that is reported in the extracted metadata, as the language attribute.

To get a desired audio language, you specify the language code, say pl for Polish, as the value of language for the audio format, so -f 'bestvideo+bestaudio[language=pl]' (Windows: '...' -> "..."), or, if there are language-specific combined audio+video formats, `-f '(bestvideo+bestaudio/best)[language=?pl]'.

Example showing that the language of the selected audio format matches the requested selection:

$ python -m youtube_dl -f 'bestaudio[language=pl]' -o '%(language)s' --get-filename HwAPLk_sQ3w
pl
$

@dirkf
Copy link
Contributor

dirkf commented Aug 1, 2024

@mahaveergautamji ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants