ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.3k stars 267 forks source link

bug(YouTube): `Spoof client` patch - various side effects (watch history, auto resume playback, ...) #3208

Closed kazimmt closed 1 week ago

kazimmt commented 4 months ago

Update: All known issues are now fixed.

Bug description

Android VR spoof

iOS spoof

Acknowledgements

0xrxL commented 4 months ago

I think that iOS spoof should be the first thing to enable, because TestSuite it's too limited.

LisoUseInAIKyrios commented 4 months ago

iOS spoofing fails for some videos and Shorts. HDR videos seem to fail more often than other videos, and it's not known why.

Maybe there is a robust way to detect a failed playback, and retry the video again but switch from iOS to the test client. But the best solution is to figure out how to fix iOS playback so it's 100% reliable.

oSumAtrIX commented 4 months ago

I don't know if iOS supports HDR playback at all, but if it does, one of the request parameters may be responsible. For example currently the device type is still Android, things like that could be cause of the problem.

0xrxL commented 4 months ago

I don't know if iOS supports HDR playback at all, but if it does, one of the request parameters may be responsible. For example currently the device type is still Android, things like that could be cause of the problem.

It seems: https://www.iphoneincanada.ca/2018/05/01/youtube-ios-hdr-iphone-x/

...along with 60fps. Therefore the spoof should be improved, like you said.

eldepor commented 4 months ago

Hi. I don't know if this is spoof client patch side effect, but when I open a clip, YTRV plays the original video form the beginning, not the clip fragment.

inotia00 commented 4 months ago

It seems: https://www.iphoneincanada.ca/2018/05/01/youtube-ios-hdr-iphone-x/

...along with 60fps. Therefore the spoof should be improved, like you said.

I was looking through the NewPipeExtractor repository and found a hint about this: https://github.com/TeamNewPipe/NewPipeExtractor/issues/680#issuecomment-1002724558

You can play 60fps video by spoofing the model name to iOS device with the modelName field of the InnertubeContext$ClientInfo class.

In YouTube v19.11.43, the modelName field name is w:

const-string v1, "iPhone15,4"
iput-object v1, v0, Lcom/google/protos/youtube/api/innertube/InnertubeContext$ClientInfo;->w:Ljava/lang/String;

Also, checking the response of clientName can be helpful in finding side effects that have not yet been discovered.

For example, the ANDROID client includes a response for availablePlaybackSpeeds, but the ANDROID_TESTSUITE client does not.

├─variableSpeedConfig
│    â”‚    â”œâ”€[availablePlaybackSpeeds] (8)

: This causes spoofing with the ANDROID_TESTSUITE client makes the playback speed menu to be unavailable.

oSumAtrIX commented 4 months ago

That aligns with my assumptions. I set the field to a supporter iOS device but no 60fps or HDR playback was available.

inotia00 commented 4 months ago

I may have missed something. I will upload the code I tested to the repository.

~~EDIT: https://github.com/inotia00/revanced-patches-test/commit/57a3fd30d54236ea0a614862c83522433ff313c6 https://github.com/inotia00/revanced-integrations/commit/0231318e065d65efc77c7e512ef7453b1d7cfd3a Test it when you have time and let me know the results.~~

Since this change was merged via PR, I removed the test repository.

cyberboh commented 4 months ago

On my old tab running android 8, all live stream are showing Video unavailable after turned on Client spoof patch.

Screenshot

But it works (even 480p only) on my android 14 phone.

kazimmt commented 4 months ago

On my old tab running android 8, all live stream are showing Video unavailable after turned on Client spoof patch.

Spoof client to iOS

LisoUseInAIKyrios commented 4 months ago

On my old tab running android 8, all live stream are showing Video unavailable after turned on Client spoof patch.

Spoof client to iOS

The Test suite spoof automatically switches to iOS for live streams.

cyberboh commented 4 months ago

@kazimmt @LisoUseInAIKyrios Spoof to iOS does not work. Live streams not available still like on my screenshot above.

LisoUseInAIKyrios commented 4 months ago

@cyberboh The issue might be fixed with #3220

n1cKz1 commented 4 months ago

Are qualities and background play for live videos still not supposed to be fixed? I just tested the new iOS spoof and they seem to work fine on my end, can someone else try to verify? History is indeed still broken for brand accounts

Edit: seekbar thumbnails don't show for live videos though

cyberboh commented 4 months ago

@LisoUseInAIKyrios Still, live streams aren't playing in Android 8. Just tested new patches

n1cKz1 commented 4 months ago

They seemingly work fine on A12, all qualities background play etc.

Pamilg8 commented 4 months ago

Playback error when returning to app from background. Playback sometimes breaks when switching from background to app, but no error. But at certain times I see this error. Battery optimization is disabled for MicroG. Not live streaming. Android 12. Is there a solution? Screenshot_20240524-091921

LisoUseInAIKyrios commented 4 months ago

@n1cKz1 not all live streams have seekbar thumbnails, check the same video with unpatched app.

Background live streams play ok if the video is still playing, the issue is when switching to audio only mode.

@Pamilg8 turn on test suite spoofing.

Pamilg8 commented 4 months ago

@n1cKz1 not all live streams have seekbar thumbnails, check the same video with unpatched app.

Background live streams play ok if the video is still playing, the issue is when switching to audio only mode.

@Pamilg8 turn on test suite spoofing.

Screenshot_20240524-123758 But there are side effects

oSumAtrIX commented 4 months ago

Use the latest patches

n1cKz1 commented 4 months ago

@n1cKz1 not all live streams have seekbar thumbnails, check the same video with unpatched app.

They showed when spoofing was off, I'm gonna try again later though

Edit: Nevermind, they seem to show now, but yesterday for some reason didn't, maybe something unrelated was at fault

Pamilg8 commented 4 months ago

Use the latest patches

I am using version 4.8.2. Even opening spoof ios cilent doesn't help

oSumAtrIX commented 4 months ago

The screenshot you sent is not 4.8.2.

Pamilg8 commented 4 months ago

Screenshot_20240524-134308_ReVanced Manager

Pamilg8 commented 4 months ago

But ReVanced shows 4.8.1. Sorry, I'm not lying. I updated and patched it when you patched the version

oSumAtrIX commented 4 months ago

4.8.1 is not the latest, like I said

Pamilg8 commented 4 months ago

In ReVanceed, it is written that the watch history will not work if the spoof is opened for iOS. You have not marked here. Also speed flyout menu

jovan2009 commented 4 months ago

I patched YouTube with latest patch and now live streams don't play with screen off. Other files play ok in background, but livestreams do not. I disabled "Spoof client" and livestreams got back to normal. I don't know yet if disabling that breaks other things.

LisoUseInAIKyrios commented 4 months ago

@jovan2009 read the first post:

Background playback does not work with live videos in audio only mode (tap headphones icon)

cyberboh commented 4 months ago

@LisoUseInAIKyrios Some users is not affected to buffering issue, could you make the Client spoof patch is not turned ON by default? If force users to use it, there might any false bug reported about it. Or could you can add warning about Client spoof patch while users want to turned it ON, like: This patch only for users that affected to buffering issue, if you did not affected, turned ON this patch can cause additional bugs

oSumAtrIX commented 4 months ago

No, more people are or will and eventually everyone will be affected soon.

LisoUseInAIKyrios commented 4 months ago

Android 8.0 does not play livestreams correctly with iOS client. Fails with an error message.

cyberboh commented 4 months ago

Android 8.0 does not play livestreams correctly with iOS client. Fails with an error message.

Is it fixable or not? If not, might to add warning about it to the Client spoof patch option

LisoUseInAIKyrios commented 4 months ago

@cyberboh Android VR spoof works for live streams on Android 8.0 devices

n1cKz1 commented 4 months ago

Does history work with Android VR?

oSumAtrIX commented 4 months ago

I tested and history works

n1cKz1 commented 4 months ago

Is it possible to make history work normally on iOS client?

oSumAtrIX commented 4 months ago

Everything is possible, the question is redundant.

Pamilg8 commented 4 months ago

You need to edit the issue

SodaWithoutSparkles commented 4 months ago

I think that, after spoofing to iOS clients, the automatically generated subtitles look weird

It would appear word by word before, now it was grouped into chunks. The chunk grouping also have no regards to sentence structure. So it often breaks the line with no regards for context. For example:

Screenshot_2024-05-27-14-09-45-170_app.revanced.android.youtube-edit.jpg

Src: https://youtu.be/VZ6RZaCpIyg

This makes it hard to comprehend

CoachYT1 commented 4 months ago

iOS spoof is having the playback issue again. If i enable android testsuite it's not buffering, but when i enable iOS spoof it's buffering again

Frosty-J commented 4 months ago

Another issue I haven't seen mentioned is this appears to enable VP9 for all devices, resulting in many dropped frames at HD resolutions for devices lacking VP9 hardware decoding.

SodaWithoutSparkles commented 4 months ago

For me, spoofing to iOS forced avc1 codec (mp4). It seems that my phone cannot handle avc1 being at 2x, so there's a lot of dropped frames

Spoofing to android testsuite(?) enabled av01 again which is much smoother even at 2x

It just happens sometimes and I dont know why. It seems to not be related to this upon further tests, please disregard

LisoUseInAIKyrios commented 4 months ago

~For me, spoofing to iOS forced avc1 codec (mp4). It seems that my phone cannot handle avc1 being at 2x, so there's a lot of dropped frames~

~Spoofing to android testsuite(?) enabled av01 again which is much smoother even at 2x~

It just happens sometimes and I dont know why. It seems to not be related to this upon further tests, please disregard

That might be fixed if the spoofed device is changed from the iPhone 15 pro. That device has Av1 hardware acceleration and older iPhones do not.

SodaWithoutSparkles commented 4 months ago

Upon more extensive testing, it does seem that using iOS spoof has a much higher tendency to get avc1. I am quite sure that it is at least 90%, matching what LisoUseInAIKyrios said.

The dropped frame issue was not showing up every time. I could not find a way to reproduce it reliably, but it was appearing very frequently. It would appear randomly, but may be resolved after clearing cache while the app is still running? And when it does happen, it would drop frames more than LTT drop things. Over 80% of the frames would be dropped.

LisoUseInAIKyrios commented 4 months ago

I think that, after spoofing to iOS clients, the automatically generated subtitles look weird

Android VR spoof has word by word auto generated subtitles, just like unpatched.

inotia00 commented 4 months ago

The known side effect Player swipe gestures do not work in the Android Testsuite client or Android VR client can be fixed via the following commit: https://github.com/inotia00/revanced-patches/commit/0b35694d18958f3787128bb88187db661c098dd4 https://github.com/inotia00/revanced-integrations/commit/41d50ae5626beb5d10c4a21753fd8caf151a768b

kazimmt commented 4 months ago

@LisoUseInAIKyrios live videos do not play for me in Android VR spoof Can you reproduce the issue?

LisoUseInAIKyrios commented 4 months ago

@kazimmt Android VR spoofed live videos work on my newer Android device (just checked now), and when I last checked it also worked for Android 8/9.

Pamilg8 commented 4 months ago

Screenshot_20240531-185539 Playback error when returning to app from background in Patches version 4.8.3. I turned ios spoofing on and off and it didn't fix it. Latest MicroG version and Android 12