mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-05 17:45:49 +01:00
fix(youtube/spoof-signature-verification): fix audio during home feed video playback (#336)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
dc5c1b45ba
commit
68d09305b9
@ -0,0 +1,40 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.shared.PlayerType;
|
||||
import app.revanced.integrations.utils.LogHelper;
|
||||
|
||||
public class SpoofSignatureVerificationPatch {
|
||||
|
||||
/**
|
||||
* Protobuf parameters used by the player.
|
||||
* Known issue: YouTube client recognizes generic player as shorts video.
|
||||
*/
|
||||
private static final String GENERAL_PROTOBUF_PARAMETER = "CgIQBg";
|
||||
|
||||
/**
|
||||
* Protobuf parameter of short and YouTube story.
|
||||
*/
|
||||
private static final String SHORTS_PROTOBUF_PARAMETER = "8AEB"; // "8AEByAMTuAQP"
|
||||
|
||||
/**
|
||||
* Target Protobuf parameters.
|
||||
* Used by the generic player.
|
||||
*/
|
||||
private static final String TARGET_PROTOBUF_PARAMETER = "YADI";
|
||||
|
||||
public static String getVerificationSpoofOverride(String original) {
|
||||
PlayerType player = PlayerType.getCurrent();
|
||||
LogHelper.printDebug(() -> "Original protobuf parameter value: " + original + " PlayerType: " + player);
|
||||
if (original.startsWith(TARGET_PROTOBUF_PARAMETER) || original.length() == 0) {
|
||||
if (player == PlayerType.INLINE_MINIMAL) {
|
||||
return GENERAL_PROTOBUF_PARAMETER; // home feed autoplay
|
||||
}
|
||||
if (player.isNoneOrHidden()) {
|
||||
return SHORTS_PROTOBUF_PARAMETER; // short or story
|
||||
}
|
||||
return SHORTS_PROTOBUF_PARAMETER; // regular video player
|
||||
}
|
||||
|
||||
return original;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user