Make MWEB return the original audio track#7846
Merged
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom Aug 15, 2025
Merged
Make MWEB return the original audio track#7846FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
Conversation
efb4f5ff-1298-471a-8973-3d47447115dc
approved these changes
Aug 15, 2025
ChunkyProgrammer
approved these changes
Aug 15, 2025
kommunarr
approved these changes
Aug 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Type
Related issue
too many to link...
Description
YouTube's mobile website doesn't have an audio track selector so they try to be helpful and pick an audio track based on your display language. Which is a nice idea although in practice that means it frequently picks an AI-generated dubbing. As FreeTube has to parse many language specific strings to extract information such as published dates and view counts, it requests everything in American English (en-US), however as we only need the streaming data from the MWEB request we are not limited to just English.
This pull request finds the original audio track in the WEB response (we can't currently use it for playback because of SABR) and uses its language as the request language for the MWEB /player request, which makes it a lot more likely that YouTube will pick the original audio track as the audio track to include in the response.
Testing
Example taken from the FreeTube General Matrix chat: https://youtu.be/j8aDCBODy3A
Desktop