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

Add support for selecting highest quality audio track for each language when "best" is specified #98

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Sp5rky
Copy link

@Sp5rky Sp5rky commented Apr 13, 2024

  • The modified code checks if "all" is present in the lang list.
  • If "all" is found, it retrieves a set of unique languages from the available audio tracks.
  • For each unique language, it iterates through the audio tracks and finds the track with the highest bitrate.
  • It then adds the highest quality track for each language to the selected_audio list.
  • Finally, it sets the title.tracks.audio to the selected_audio list, containing the highest quality track for each language.
  • If "all" is not found in the lang list, the existing behavior for specific language selection is maintained.

Fixes #93

…each language when "all" is specified

This change introduces a new feature where, if the user specifies "all" for the language option, the script now selects the highest quality audio track available for each unique language present in the title's audio tracks. This ensures that users who want to download audio tracks in all available languages get the best possible quality for each language. Previously, the script would either exit with an error if a specific language was not found or only process audio tracks in a single language. This enhancement makes the tool more versatile and user-friendly for scenarios where high-quality audio in multiple languages is desired.
@Sp5rky Sp5rky changed the title ✨ (dl.py): Add support for selecting highest quality audio track for each language when "all" is specified Add support for selecting highest quality audio track for each language when "all" is specified Apr 13, 2024
Cleanup unnecessary use of list, set, dict around a generator expression to get an object of that type since there are comprehensions for these types.

And fixed formatted string passed to logging module
Change naming scheme as -l best seems easier to understand than -l all
@Sp5rky
Copy link
Author

Sp5rky commented Apr 16, 2024

Changed naming of -l all to -l best as I feel its easier to understand

We create a new list ``video_languages`` that includes all elements from ``v_lang`` or ``lang`` except for the "best" keyword.
Then, we use this new ``video_languages`` list to filter the video tracks, ensuring that the "best" keyword doesn't interfere with the selection process.
@Sp5rky Sp5rky changed the title Add support for selecting highest quality audio track for each language when "all" is specified Add support for selecting highest quality audio track for each language when "best" is specified Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-l all flag should probably take all lang instead of take all tracks
1 participant