-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
bug(YouTube - Spoof video streams): Android VR client side effects (Livestreams start from beginning, Videos end 1 second early) #4081
Comments
Both of these are known iOS issues. Is this now happening with Android VR? The one second early issue affects Shorts the most. |
Yes, Added a screenshot and video. |
I can reproduce the 1 second issue. Setting the app language for the Android VR request is what changed. |
I tried changing to Android Unplugged instead of VR and it has the same issues when the language code is set (plus the video initially stutters when playing a new video). A solution is to modify the client logic that picks which audio stream to use and set the preferred language there. Then Android VR could skip setting the language code in the request. If that cannot be figured out then a temporary fix could be to add a 'Default' language type where no language code is set. That would cause the audio track menu to always show English text for iOS, and for users without the a/b localized audio it would force the original language for all videos. But for users who have the a/b localized language change (which seems likely it will come to all users soon), they will still have whatever audio language the app chooses. |
@LisoUseInAIKyrios I recently tried to fix this lack by searching a way to restore the original flyout button, and I found a class where the visibility of this button change to true or false, if the size of a list field (that contains all the available audio) tracks is greater than 1. Maybe you know a way to add more languages to that list, and restore the button visibility. 🤷♂️ |
Does Android VR return more than one audio stream? If the menu entries are missing maybe it can be added as you said. |
Nope, just return the system language. In fact, once I set the button visibility to true, I was only able to see my region language inside tracks flyout. More languages can be added...maybe. |
Yup it sure is. Setting the language (in all uppercase) fixed that. |
This comment has been minimized.
This comment has been minimized.
Yup that too. |
Livestreams in progress start from the beginning. Past livestreams and some 24/7 live streams don't show the issue. Videos ending 1 second early is only noticable on Shorts that run up to the very end. (Video for reference. The joke "soon...with me" is cutoff https://youtube.com/shorts/MH4TCnitr-Q) |
If someone can figure out a fix. |
Thanks to a not-merged solution founded by @YT-Advanced, I added an improved version of it on my integrations, to detect if a video is live stream or not. If you know a way to automatically seek a video to a precise time, you can combine the two things to fix the "live stream start from beginning" issue. |
Video information can seek to the end of the video on video start, if it's known to be a livestream. Sending a language parameter for VR will cause livestreams to start from the beginning, but not sending language causes it to start at the live time. It might be as simple as sending language code but changing some of the returned data to be the same as when no language parameter is included. The ending 1 second early might be the video length is rounded down from a float to an int, and only affects videos that dont end on exact whole second boundaries. Maybe adding +1 second to the video length could fix it (or maybe break something), not sure. |
The reason playback starts at the beginning is because in the DASH manifest a parameter is different. It is assumed by others to be a bug in ExoPlayer. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I just noticed the Android VR request is failing, but due to an issue with how it's logged it falls over to iOS without showing any errors when debug is enabled. 🤦 So, this is actually an issue caused by Android VR failing and it falling over to iOS. Will revert this in a PR soon. |
Side effects will be the same as before. No audio track menu, no stable volume. But no other side effects. |
Tried the last PR, selecting the preferred audio track language doesn't work for Android VR, but now livestreams starts correctly. |
With Android VR the only way to get the 'original' audio track seems to be if no audio language is specified. But I don't know if that works for users with the A/B auto selection of localized languages (I don't have that feature). If a user always get the original language when using Android VR then great, but if they still get the localized language then the default audio track option will have to be an iOS spoofing option. |
It seems there is no obvious way to force Android VR to use a specific language. Will refactor the change audio track patch so it only turns off the automatic selection of tracks for iOS and when spoofing is off. And a default audio track can be selected for iOS spoofing. |
One of the side effects of iOS client - I already checked all experimental flags a few months ago, and didn't find this flag then. It seems to be an experimental flag that became available after the change to no longer set the |
Ending 1 second early is caused by the video length rounded down. Not sure if the rounding is already present when coming across the wire, or if the client is rounding down (it happening on the backend seems more likely). Maybe could fix by adding 0.95 seconds to each video length (only if the length is already a whole second), but maybe that could cause it's own issues. iOS:
Android VR:
|
iOS ending early is fixed by adding just 1ms to the time. It's probably a difference of YouTube for IOS using < while YouTube for Android using <=
|
Manually padding out the video time fixes iOS...but only if the video was recently opened with spoofing off or was spoofing with Android VR. I assume it's caching the video data from the prior request, or the video length isn't being modified in quite the right place. Not as simple as it first appeared and needs more inspection. |
For more information, the videoLength is extracted from |
Bug description
If the
Spoof video streams
andAndroid VR
client is enabled, livestreams start from the beginning and videos end 1 second earlier.(Maybe other iOS side effects as well.)
ReVanced patches v5.3.0
Screenrecorder-2024-12-09-14-45-40-517.mp4
Error logs
Solution
No response
Additional context
No response
Acknowledgements
The text was updated successfully, but these errors were encountered: