-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
fix(YouTube - Spoof video streams): Update client user-agent #4304
fix(YouTube - Spoof video streams): Update client user-agent #4304
Conversation
LisoUseInAIKyrios
commented
Jan 16, 2025
•
edited
Loading
edited
- Adjusts the client user agent to match the spoofed apps
- Fixes wrong key name used for client id
- Skips clients that require auth if the user is not logged in or is in incognito mode
…y YouTube clients
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
e03b53b
to
32474c2
Compare
I don't see the need to make it "more" authentic. It does not help in any realistic way. If YT wants to, it will detect invalid use of the API, regardless of how authentic we make it appear. If they don't, then there's no point to in the first place. I don't think the added code/complexity is worth this. |
Some of the spoofed values such as the user agent have not been exactly correct until now. The client id is also using the wrong key name (fixed with this PR). Previously fixing the parameters also fixed some of the side effects, such as the last commit where the os name was missing and adding that restores AV1 for Android VR. |
Only the fields are necessary which are also used by the other YT projects such as YT-DL afaik. The chipset is for example unnecessary. |
I changed the user agent to an identical match of what is created in the spoofed apps (user-agent was found by inspecting the original app apks). Much more reliable then copy pasting what is randomly posted on the internet. Also removed the more questionable fields such as chipset. |
…cted by the spoofed client
13e1395
to
7f5ca5f
Compare
UPDATE: After further testing I can confirm that this PR leads to an improvement in buffering...despite being small. Maybe some users will notice more marked improvements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for replacing a single user agent string parameter into multiple parameters?
extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java
Outdated
Show resolved
Hide resolved
The parameters are already present since clientVersion/make/model/etc is used in both the user agent and a request parameter of its own. The user agent format for all android clients is 100% identical except for the values of course. So creating the user agent in the constructor removed the copy pasted data and it's only declared once. |
It would avoid a lot of lines of code, such as the fields, the parameters, the complex string replacement and concatenation code for the user agent. It's probably better to replace all that in favor of a little copy pasta. |
Just use String.format. |
String format would clean it up a little. Will change tomorrow. |
89ba839
to
9319103
Compare
@YT-Advanced Is it confirmed that adding those parameters fixes the device botguard exception? I cannot reproduce the problem so I cannot verify. |
Can make another PR for any other changes. |
# [5.9.0-dev.4](v5.9.0-dev.3...v5.9.0-dev.4) (2025-01-20) ### Bug Fixes * **YouTube - Spoof video streams:** Update client user-agent ([#4304](#4304)) ([7917871](7917871))
# [5.9.0](v5.8.1...v5.9.0) (2025-01-20) ### Bug Fixes * **YouTube - Spoof video streams:** Resolve playback issues after changing from cellular to wifi ([#4277](#4277)) ([e93e1c8](e93e1c8)) * **YouTube - Spoof video streams:** Update client user-agent ([#4304](#4304)) ([7917871](7917871)) ### Features * **YouTube - Hide feed components:** Handle new type of surveys ([#4295](#4295)) ([c770e03](c770e03)) * **YouTube - Playback speed:** Add option to change 2x tap and hold speed ([#4307](#4307)) ([02fb26e](02fb26e)) * **YouTube - Settings:** Add option to use new Cairo settings menus ([#4305](#4305)) ([7b8a2a2](7b8a2a2))