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

bug(YouTube): Spoof client patch - various side effects #3208

Open
10 of 23 tasks
kazimmt opened this issue May 21, 2024 · 60 comments · Fixed by #3220 or #3230
Open
10 of 23 tasks

bug(YouTube): Spoof client patch - various side effects #3208

kazimmt opened this issue May 21, 2024 · 60 comments · Fixed by #3220 or #3230
Labels
Bug report Something isn't working

Comments

@kazimmt
Copy link
Contributor

kazimmt commented May 21, 2024

Bug description

Android VR spoof

  • Subtitle / closed captions are not available
  • Watch history does not work with a brand account
  • Speed menu is missing
  • Player fullscreen swipe gestures do not work
  • No HDR video
  • Low quality Shorts seekbar thumbnails
  • No playback of videos intended for children
  • Player download action button is always hidden
  • Video resolution can permanently change after locking screen in background playback
  • Video end screen cards are always hidden
  • Paused videos can randomly resume playback

iOS spoof

  • Subtitle / closed captions are not available
  • Player fullscreen swipe gestures do not work
  • Speed menu is missing
  • No HDR video
  • Watch history does not work with a brand account
  • Higher video qualities may be missing
  • Live videos do not work with audio only background playback (tap pip headphones icon)
  • Live videos do not work on Android 8.0 devices
  • Video playback excessive dropped frames (video stuttering)

Acknowledgements

  • This issue is not a duplicate of an existing bug report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@0xrxL
Copy link

0xrxL commented May 21, 2024

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

@LisoUseInAIKyrios
Copy link
Contributor

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
Copy link
Member

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
Copy link

0xrxL commented May 22, 2024

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
Copy link

eldepor commented May 22, 2024

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
Copy link

inotia00 commented May 22, 2024

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:
TeamNewPipe/NewPipeExtractor#680 (comment)

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
Copy link
Member

oSumAtrIX commented May 22, 2024

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

@inotia00
Copy link

inotia00 commented May 22, 2024

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
inotia00/revanced-integrations@0231318
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
Copy link

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
Copy link
Contributor Author

kazimmt commented May 23, 2024

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
Copy link
Contributor

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
Copy link

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

@LisoUseInAIKyrios
Copy link
Contributor

@cyberboh The issue might be fixed with #3220

@n1cKz1
Copy link

n1cKz1 commented May 24, 2024

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
Copy link

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

@n1cKz1
Copy link

n1cKz1 commented May 24, 2024

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

@Pamilg8
Copy link

Pamilg8 commented May 24, 2024

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
Copy link
Contributor

@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

This comment was marked as outdated.

@oSumAtrIX

This comment was marked as resolved.

@n1cKz1
Copy link

n1cKz1 commented May 24, 2024

Does history work with Android VR?

@oSumAtrIX
Copy link
Member

I tested and history works

@n1cKz1
Copy link

n1cKz1 commented May 24, 2024

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

@oSumAtrIX
Copy link
Member

Everything is possible, the question is redundant.

@Pamilg8

This comment was marked as spam.

@SodaWithoutSparkles
Copy link
Contributor

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

This comment was marked as spam.

@Frosty-J
Copy link

Frosty-J commented May 28, 2024

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

This comment has been minimized.

@LisoUseInAIKyrios
Copy link
Contributor

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
Copy link
Contributor

SodaWithoutSparkles commented May 28, 2024

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
Copy link
Contributor

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
Copy link

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:
inotia00/revanced-patches@0b35694
inotia00/revanced-integrations@41d50ae

@kazimmt
Copy link
Contributor Author

kazimmt commented May 31, 2024

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

@LisoUseInAIKyrios
Copy link
Contributor

@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

This comment was marked as resolved.

@LisoUseInAIKyrios

This comment was marked as resolved.

@Pamilg8

This comment was marked as resolved.

@Pamilg8

This comment was marked as resolved.

@LisoUseInAIKyrios

This comment was marked as resolved.

@Pamilg8

This comment was marked as resolved.

@LisoUseInAIKyrios

This comment was marked as resolved.

@eldepor

This comment was marked as resolved.

@Pamilg8

This comment was marked as resolved.

@ReVanced ReVanced locked as spam and limited conversation to collaborators May 31, 2024
@oSumAtrIX oSumAtrIX pinned this issue Jun 2, 2024
@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Jun 7, 2024

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

I ran into a livestream that did not playback with Android VR. Changing the client from Oculus to Oculus 3 fixed the livestream, but then audio only playback of regular videos fails to work.

The old code of detecting livestream videos could be brought back, and then use Oculus 3 client name only for livestreams.

Edit: Android VR livestreams seem to be fixed by #3316

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Jun 17, 2024

Perhaps this logic should be removed, and instead it always uses a non av1 iOS device.

The stuttering may be from the device overheating and throttling. Even though the Android device has AV1 hardware it might be too much to do av1 decoding and run the bloated stock YT code at the same time.

Or maybe the av1 YT stream has features found on iOS hardware but not on some android av1 devices, such as 10-bit depth color or 4:4:4 chroma sampling (both appear to be optional for av1 hardware decoders, and if present would force software decoding). Just speculation for this.

Edit: I just noticed this is for avc1 and not av1. So this might be fixed by checking if the device supports both avc1 and av1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug report Something isn't working
Projects
None yet