-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
feat(YouTube - Spoof video streams): Allow picking a default audio language track #4050
feat(YouTube - Spoof video streams): Allow picking a default audio language track #4050
Conversation
.../youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/AudioStreamLanguage.java
Outdated
Show resolved
Hide resolved
0e88464
to
7019a50
Compare
13801e3
to
32a3973
Compare
...main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java
Show resolved
Hide resolved
...main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java
Show resolved
Hide resolved
...main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java
Show resolved
Hide resolved
Why is the language only set for iOS spoofs? According to the linked issue in Android VR the audio also changes unintendedly. |
This comment was marked as outdated.
This comment was marked as outdated.
On checking again, the default audio language is changed for Android VR. Not sure why it didn't work earlier. Edit: Android VR failed because it expects an uppercase language code. |
I am wondering, why the user has to manually select the language. What makes it hard to automatically behave like the unspoofed version? Isn't the system language used in the request by default? If so, it may be better to separate the patches and force the default app behaviour in the spoof video streams patch. How it would work is that a new "Change default video language" patch would be added. It could work in relation to the spoof video stream so that when the patch is used, it would interface properly and change the default video language for spoofed streams accordingly. When the spoof stream patch is not used, the original request audio stream is changed |
The only problem with separating the patch, is right now this is a sub patch of the spoof stream patch. Including it requires including spoof stream, so they're not really separate. If a way is figured out to change the default audio language without spoofing, then yes it definitely makes sense to make a new patch. It probably would not be difficult to change, if the code responsible was found. But it's simpler and less confusing if this is part of spoof stream since they're both intertwined. Without this change spoofing should be picking the correct default audio stream, but the issue is using are getting served junk AI localized audio even in unpatched YouTube. So at least with this they can change the default. |
The Spoof Video Streams patch has a clear and specific purpose to fix playback functionality. Addressing YouTube's changes to the default audio language falls outside this patch's intended scope. While it’s true that YouTube allows users to change the audio language via the track menu, the Spoof Video Streams inadvertently breaks that functionality and so, this should be treated as a bug to be fixed rather than introducing a workaround in this PR. To make a separate "Change Default Audio Language" patch, we need to hook into YouTube's code where it creates the request body. This would let us change the language there. A quick search for system APIs to get the current system language should help. We also already know how when we spoofed the request client version by overriding a field. The same class that holds this field also stores the language field, which is easy to override. If supporting unspoofed streams isn’t needed (since it doesn't work without root anyways), the patch can be turned off when spoofing is off. This can be done by organizing the code properly to handle these cases. This just requires a bit of refactoring in this PR. |
fbe4d51
to
9b03d10
Compare
I think I see where the language is set for non spoofed calls. I'll try refactoring into a separate patch. |
I tried replacing every instance of:
And the default audio stream is still English. I think the language parameter is coming from somewhere else, and perhaps it's sent from the Google account settings since users report the default audio language can be a foreign language even when the app is set to English. @oSumAtrIX Merge this as-is? If the audio stream parameter can be found then refactoring will be easy, but until then this is about as good as it'll get. |
…rred_audio_language # Conflicts: # extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java # extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/requests/PlayerRoutes.java # extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java # patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
I remember trying to patch that specific method, and also patching every place that Locale.toLanguageTag() was used, and the default audio language still did not change. But my YT account isn't affected by the localized language feature rollout, so maybe that's why. I'll look into this more later, but for now will merge this since the feature is useful now. |
# [5.3.0-dev.6](v5.3.0-dev.5...v5.3.0-dev.6) (2024-12-09) ### Features * **YouTube - Spoof video streams:** Allow picking a default audio language track ([#4050](#4050)) ([ede666b](ede666b))
# [5.3.0](v5.2.3...v5.3.0) (2024-12-09) ### Bug Fixes * **Change package name:** Prevent applying the patch to known incompatible apps ([#3943](#3943)) ([44936e7](44936e7)) * **Reddit:** Fix patches by using correct extension class ([70bdc68](70bdc68)) * **Sync for Reddit:** Fix patches by using correct extension name ([030093e](030093e)) * **Twitter:** Merge correct extension by depending on correct extension patch ([8281cf6](8281cf6)) * **YouTube - Spoof video streams:** Add missing preferred language preference to the settings ([630633c](630633c)) * **YouTube - Spoof video streams:** Enable opus codec by updating iOS client version ([#4063](#4063)) ([0af156f](0af156f)) * **YouTube - Spoof video streams:** Update `Force AVC` client data ([#4064](#4064)) ([7d537dd](7d537dd)) * **YouTube Music - Permanent shuffle:** Remove obsolete and non functional patch ([#4073](#4073)) ([fbc6ab6](fbc6ab6)) ### Features * **Nyx:** Remove broken `Unlock pro` patch ([1fe8b16](1fe8b16)) * **YouTube - Spoof video streams:** Allow picking a default audio language track ([#4050](#4050)) ([ede666b](ede666b)) * **YouTube Music:** Add `Spoof video streams` patch to fix playback ([#4065](#4065)) ([cf3116a](cf3116a)) * **YouTube:** Add `Open videos fullscreen` patch ([#4069](#4069)) ([296d63b](296d63b))
# [5.0.0](v4.16.0...v5.0.0) (2024-12-11) ### Bug Fixes * Add missing dependency to patch ([97f5240](97f5240)) * **Change package name:** Prevent applying the patch to known incompatible apps ([ReVanced#3943](https://github.com/Chr0matic1/revanced-patches/issues/3943)) ([44936e7](44936e7)) * **My Expenses - Unlock pro:** Constrain compatible version to working version ([ReVanced#3974](https://github.com/Chr0matic1/revanced-patches/issues/3974)) ([ba3bf69](ba3bf69)) * **MyFitnessPal - Hide ads:** Constrain patch to last working version ([ReVanced#3847](https://github.com/Chr0matic1/revanced-patches/issues/3847)) ([f9fa526](f9fa526)) * **Reddit:** Fix patches by using correct extension class ([70bdc68](70bdc68)) * **Sync for Reddit - Fix /s/ links:** Fix patch by using correct fingerprints ([a0ad07e](a0ad07e)) * **Sync for Reddit - Spoof client:** Fix patch by using correct fingerprints ([5776de3](5776de3)) * **Sync for Reddit:** Fix patches by using correct extension name ([030093e](030093e)) * **Sync:** Fix patches by not throwing unnecessarily ([2ee1316](2ee1316)) * **Tiktok - Settings:** Fix the patch by depending on the correct settings patch ([0c75929](0c75929)) * **Twitch:** Resolve setting menu crashes ([ReVanced#4025](https://github.com/Chr0matic1/revanced-patches/issues/4025)) ([62df596](62df596)) * **Twitter - Change link sharing domain:** Support latest app version ([ReVanced#3786](https://github.com/Chr0matic1/revanced-patches/issues/3786)) ([b54592c](b54592c)) * **Twitter - Unlock downloads:** Make it work with latest versions ([ReVanced#3782](https://github.com/Chr0matic1/revanced-patches/issues/3782)) ([5189122](5189122)) * **Twitter:** Fix patches by depending on patch that merges required extension ([c330e9d](c330e9d)) * **Twitter:** Fix patches by matching fingerprint using correct class ([6ae0d12](6ae0d12)) * **Twitter:** Merge correct extension by depending on correct extension patch ([8281cf6](8281cf6)) * **YouTube - Change header:** Apply header changes to A/B layout ([ReVanced#3907](https://github.com/Chr0matic1/revanced-patches/issues/3907)) ([6ccf114](6ccf114)) * **YouTube - Copy video URL:** Support A/B player layout ([0f42574](0f42574)) * **YouTube - Custom branding:** Change icon correctly on 19.34+ ([ReVanced#3866](https://github.com/Chr0matic1/revanced-patches/issues/3866)) ([2e47903](2e47903)) * **YouTube - GmsCore support:** Add more replacements ([4d39770](4d39770)) * **YouTube - GmsCore support:** Remove unclear patch changes ([021d858](021d858)) * **YouTube - Hide ads:** Hide new types of ads ([454281a](454281a)) * **YouTube - Hide layout components:** Adjust settings text ([ReVanced#3745](https://github.com/Chr0matic1/revanced-patches/issues/3745)) ([13998bb](13998bb)) * **YouTube - Hide layout components:** Move hide chips settings to Feed menu ([1ed677f](1ed677f)) * **YouTube - Hide layout components:** Remove obsolete 'Hide gray separator' ([a697701](a697701)) * **YouTube - Hide Shorts components:** Add missing options to patch ([65f62fc](65f62fc)) * **YouTube - Hide Shorts components:** Do not hide Shorts action buttons on app first launch ([ReVanced#3933](https://github.com/Chr0matic1/revanced-patches/issues/3933)) ([0d78815](0d78815)) * **YouTube - Playback speed:** Add 'Auto' speed. Always override speed if default is set to 1.0x ([ReVanced#3914](https://github.com/Chr0matic1/revanced-patches/issues/3914)) ([497739e](497739e)) * **YouTube - Playback speed:** Allow long press 2x speed when using custom playback speeds ([ReVanced#3990](https://github.com/Chr0matic1/revanced-patches/issues/3990)) ([79a543a](79a543a)) * **YouTube - Playback speed:** Remember playback speed when using non 1.0x default speed ([05b9f87](05b9f87)), closes [ReVanced#3810](https://github.com/Chr0matic1/revanced-patches/issues/3810) * **YouTube - Playback speed:** Remember playback speed with new speed menu ([ReVanced#3810](https://github.com/Chr0matic1/revanced-patches/issues/3810)) ([c3a5e14](c3a5e14)) * **YouTube - Playback speed:** Restore old playback speed menu ([ReVanced#3817](https://github.com/Chr0matic1/revanced-patches/issues/3817)) ([806b210](806b210)) * **YouTube - Player controls:** Show player control buttons with A/B layout ([ReVanced#3901](https://github.com/Chr0matic1/revanced-patches/issues/3901)) ([bb526bc](bb526bc)) * **YouTube - Remember video quality:** Correctly set default quality when changing from a low quality video ([ReVanced#3879](https://github.com/Chr0matic1/revanced-patches/issues/3879)) ([ddb73e8](ddb73e8)) * **YouTube - Remove background playback restrictions:** Enable for Shorts as well ([ReVanced#3671](https://github.com/Chr0matic1/revanced-patches/issues/3671)) ([7db1a77](7db1a77)) * **YouTube - Return YouTube Dislike:** Show Shorts dislikes with new A/B button icons ([084e0a5](084e0a5)) * **YouTube - Return YouTube Dislike:** Use latest separator height ([ae160a3](ae160a3)) * **YouTube - Seekbar:** Use latest shade of YouTube red ([4b77648](4b77648)) * **YouTube - Settings:** Do not clip settings menus when using an Android 15 device ([ReVanced#3999](https://github.com/Chr0matic1/revanced-patches/issues/3999)) ([7382a02](7382a02)) * **YouTube - Settings:** Show navigation back button in setting sub menus ([ReVanced#3991](https://github.com/Chr0matic1/revanced-patches/issues/3991)) ([e61686c](e61686c)) * **YouTube - Settings:** Use multiline preference title for localized languages ([ReVanced#3821](https://github.com/Chr0matic1/revanced-patches/issues/3821)) ([ff85d49](ff85d49)) * **YouTube - SponsorBlock:** Fix create new segment crash on tablet custom roms ([ReVanced#3946](https://github.com/Chr0matic1/revanced-patches/issues/3946)) ([a0da377](a0da377)) * **YouTube - SponsorBlock:** Show correct segment behavior in settings UI after importing ([e3f25a0](e3f25a0)) * **YouTube - Spoof app version:** Adjust legacy spoof targets ([ReVanced#3934](https://github.com/Chr0matic1/revanced-patches/issues/3934)) ([f5794c1](f5794c1)) * **YouTube - Spoof app version:** Remove broken spoof targets when patching 19.25+ ([ReVanced#3915](https://github.com/Chr0matic1/revanced-patches/issues/3915)) ([9e18eca](9e18eca)) * **YouTube - Spoof app version:** Remove obsolete 17.33.42 spoof target ([ReVanced#3825](https://github.com/Chr0matic1/revanced-patches/issues/3825)) ([33aeba2](33aeba2)) * **YouTube - Spoof app version:** Update spoof target to resolve library tab crashes ([ReVanced#4014](https://github.com/Chr0matic1/revanced-patches/issues/4014)) ([c8eced5](c8eced5)) * **YouTube - Spoof app version:** Update spoof target to resolve library tab crashes ([ReVanced#4019](https://github.com/Chr0matic1/revanced-patches/issues/4019)) ([d89ad65](d89ad65)) * **YouTube - Spoof video streams:** Add missing preferred language preference to the settings ([630633c](630633c)) * **YouTube - Spoof video streams:** Enable opus codec by updating iOS client version ([ReVanced#4063](https://github.com/Chr0matic1/revanced-patches/issues/4063)) ([0af156f](0af156f)) * **YouTube - Spoof video streams:** Fix playback for Android VR by removing invalid body as well ([ReVanced#3769](https://github.com/Chr0matic1/revanced-patches/issues/3769)) ([5150a15](5150a15)) * **YouTube - Spoof video streams:** Log out the iOS client to restore kids videos playback ([ReVanced#4000](https://github.com/Chr0matic1/revanced-patches/issues/4000)) ([cc2ac4e](cc2ac4e)) * **YouTube - Spoof video streams:** Update `Force AVC` client data ([ReVanced#4064](https://github.com/Chr0matic1/revanced-patches/issues/4064)) ([7d537dd](7d537dd)) * **YouTube - Spoof video streams:** Use system language as default iOS audio stream ([ReVanced#4042](https://github.com/Chr0matic1/revanced-patches/issues/4042)) ([4017185](4017185)) * **YouTube Music - GmsCore support:** Resolve patching errors ([ReVanced#4056](https://github.com/Chr0matic1/revanced-patches/issues/4056)) ([38a4bad](38a4bad)) * **YouTube Music - Hide category bar:** Add support for latest release ([ReVanced#3968](https://github.com/Chr0matic1/revanced-patches/issues/3968)) ([b63fdeb](b63fdeb)) * **YouTube Music - Permanent shuffle:** Remove obsolete and non functional patch ([ReVanced#4073](https://github.com/Chr0matic1/revanced-patches/issues/4073)) ([fbc6ab6](fbc6ab6)) * **YouTube:** Merge `Restore old seekbar thumbnails` into `Seekbar thumbnails` ([ReVanced#3860](https://github.com/Chr0matic1/revanced-patches/issues/3860)) ([e377b1e](e377b1e)) ### Build System * Bump ReVanced Patcher ([eee1692](eee1692)) ### Features * **Backdrops - Pro unlock:** Support latest versions by removing version constraint ([a62b506](a62b506)) * **Facebook:** Add `Hide sponsored stories` patch ([ReVanced#3627](https://github.com/Chr0matic1/revanced-patches/issues/3627)) ([214c72b](214c72b)) * **Nyx:** Remove broken `Unlock pro` patch ([1fe8b16](1fe8b16)) * **Sync for Reddit:** Add `Fix video downloads` patch ([ReVanced#3739](https://github.com/Chr0matic1/revanced-patches/issues/3739)) ([a47ee38](a47ee38)) * **TikTok:** Add ReVanced settings about screen ([ReVanced#4009](https://github.com/Chr0matic1/revanced-patches/issues/4009)) ([12ea26b](12ea26b)) * **Twitter:** Add `Change link sharing domain` patch ([ReVanced#3753](https://github.com/Chr0matic1/revanced-patches/issues/3753)) ([9269a07](9269a07)) * **VSCO:** Remove non functional `Unlock pro` patch ([4fddb19](4fddb19)) * **Willhaben:** Add `Hide ads` patch ([ReVanced#3740](https://github.com/Chr0matic1/revanced-patches/issues/3740)) ([1fe3a52](1fe3a52)) * **YouTube - Hide layout components:** Add option to hide Yoodles (YouTube Doodles) ([ReVanced#3743](https://github.com/Chr0matic1/revanced-patches/issues/3743)) ([b8c8916](b8c8916)) * **YouTube - Hide layout components:** Hide player shopping shelf ([ReVanced#3804](https://github.com/Chr0matic1/revanced-patches/issues/3804)) ([1952f3b](1952f3b)) * **YouTube - Hide player flyout menu items:** Hide stable volume ([ReVanced#3827](https://github.com/Chr0matic1/revanced-patches/issues/3827)) ([b91e932](b91e932)) * **YouTube - Hide Shorts components:** Add option to hide `Use template`, `Upcoming`, `Green screen` buttons ([ReVanced#3752](https://github.com/Chr0matic1/revanced-patches/issues/3752)) ([f71c406](f71c406)) * **YouTube - Hide Shorts components:** Add option to hide like fountain ([ReVanced#3731](https://github.com/Chr0matic1/revanced-patches/issues/3731)) ([00a99dd](00a99dd)) * **YouTube - Hide Shorts components:** Hide `Hashtag` button ([ReVanced#3787](https://github.com/Chr0matic1/revanced-patches/issues/3787)) ([828a634](828a634)) * **YouTube - Miniplayer:** Add horizontal drag gesture ([ReVanced#3859](https://github.com/Chr0matic1/revanced-patches/issues/3859)) ([e32b19e](e32b19e)) * **YouTube - Miniplayer:** Add option to disable miniplayer ([ReVanced#3961](https://github.com/Chr0matic1/revanced-patches/issues/3961)) ([e565cdb](e565cdb)) * **YouTube - Player flyout menu:** Hide sleep timer ([ReVanced#3637](https://github.com/Chr0matic1/revanced-patches/issues/3637)) ([7e1bdab](7e1bdab)) * **YouTube - Spoof video streams:** Allow picking a default audio language track ([ReVanced#4050](https://github.com/Chr0matic1/revanced-patches/issues/4050)) ([ede666b](ede666b)) * **YouTube - Theme:** Apply custom seekbar color to splash screen animation ([ReVanced#3978](https://github.com/Chr0matic1/revanced-patches/issues/3978)) ([98d57e2](98d57e2)) * **YouTube Music:** Add `Spoof video streams` patch to fix playback ([ReVanced#4065](https://github.com/Chr0matic1/revanced-patches/issues/4065)) ([cf3116a](cf3116a)) * **YouTube:** Add `Open videos fullscreen` patch ([ReVanced#4069](https://github.com/Chr0matic1/revanced-patches/issues/4069)) ([296d63b](296d63b)) * **YouTube:** Add `Seekbar thumbnails` patch ([ReVanced#3813](https://github.com/Chr0matic1/revanced-patches/issues/3813)) ([5988b75](5988b75)) * **YouTube:** Add `Shorts autoplay` patch ([ReVanced#3794](https://github.com/Chr0matic1/revanced-patches/issues/3794)) ([96b5aed](96b5aed)) * **YouTube:** Hide player shopping shelf in playlists ([ReVanced#3806](https://github.com/Chr0matic1/revanced-patches/issues/3806)) ([a553a13](a553a13)) * **YouTube:** Merge multiple layout patches into `Hide Layout Components` ([ReVanced#3799](https://github.com/Chr0matic1/revanced-patches/issues/3799)) ([bbcb57a](bbcb57a)) * **YouTube:** Merge multiple player overlay patches into `Hide player overlay buttons` ([ReVanced#3800](https://github.com/Chr0matic1/revanced-patches/issues/3800)) ([4ba0300](4ba0300)) * **YouTube:** Support version `19.43.41` ([ReVanced#3854](https://github.com/Chr0matic1/revanced-patches/issues/3854)) ([85de5c7](85de5c7)) * **YouTube:** Support version `19.45.38` ([ReVanced#3938](https://github.com/Chr0matic1/revanced-patches/issues/3938)) ([7c4e3fe](7c4e3fe)) * **YouTube:** Support version `19.46.42` ([ReVanced#4010](https://github.com/Chr0matic1/revanced-patches/issues/4010)) ([122aac6](122aac6)) * **YouTube:** Support versions `19.25` and `19.34` ([ReVanced#3629](https://github.com/Chr0matic1/revanced-patches/issues/3629)) ([049e7f0](049e7f0)) ### Performance Improvements * Check for extension without a class proxy ([a6a74e2](a6a74e2)) * Move variables to local scope ([43c0421](43c0421)) * **YouTube - GmsCore support:** Improve performance by using hashsets ([2c5d390](2c5d390)) ### BREAKING CHANGES * Various APIs have been changed or removed.
Uhm in my side ( |
Edit: android VR is broken with uppercase and spoofing fell over to iOS. Logging was lacking so it went unnoticed. |
I mean Example request: https://restninja.io/share/57e6cfd07b31448cf5799d196f660bbd02cd063f/0 |
Allows picking a preferred default audio stream language.