feat(YouTube - Spoof video streams): Add iPadOS client

This commit is contained in:
LisoUseInAIKyrios
2025-09-16 15:33:55 +04:00
parent 9f0558e494
commit 2726231404
7 changed files with 78 additions and 15 deletions

View File

@@ -14,12 +14,13 @@ public class ForceOriginalAudioPatch {
* Injection point.
*/
public static void setPreferredLanguage() {
if (Settings.FORCE_ORIGINAL_AUDIO.get()) {
// None of the current spoof clients support audio track menu,
// And all are un-authenticated and can request any language code
// (authenticated requests ignore the language code and always use the account language).
// To still support force original audio, if it's enabled then pick a language
// that is not auto-dubbed by YouTube: https://support.google.com/youtube/answer/15569972
if (Settings.FORCE_ORIGINAL_AUDIO.get()
&& SpoofVideoStreamsPatch.spoofingToClientWithNoMultiAudioStreams()) {
// If client spoofing does not use authentication and lacks multi-audio streams,
// then can use any language code for the request and if that requested language is
// not available YT uses the original audio language. Authenticated requests ignore
// the language code and always use the account language. Use a language that is
// not auto-dubbed by YouTube: https://support.google.com/youtube/answer/15569972
// but the language is also supported natively by the Meta Quest device that
// Android VR is spoofing.
AppLanguage override = AppLanguage.SV;

View File

@@ -3,6 +3,7 @@ package app.revanced.extension.youtube.patches.spoof;
import static app.revanced.extension.shared.spoof.ClientType.ANDROID_CREATOR;
import static app.revanced.extension.shared.spoof.ClientType.ANDROID_VR_1_43_32;
import static app.revanced.extension.shared.spoof.ClientType.ANDROID_VR_1_61_48;
import static app.revanced.extension.shared.spoof.ClientType.IPADOS;
import static app.revanced.extension.shared.spoof.ClientType.VISIONOS;
import java.util.List;
@@ -22,6 +23,7 @@ public class SpoofVideoStreamsPatch {
ANDROID_VR_1_61_48,
ANDROID_CREATOR,
VISIONOS,
IPADOS,
// VR 1.43 must be last as spoof streaming data handles it slightly differently.
ANDROID_VR_1_43_32
);

View File

@@ -78,18 +78,25 @@ public class SpoofStreamingDataSideEffectsPreference extends Preference {
Logger.printDebug(() -> "Updating spoof stream side effects preference");
setEnabled(BaseSettings.SPOOF_VIDEO_STREAMS.get());
String title = str("revanced_spoof_video_streams_about_title");
// Currently only Android VR and VisionOS are supported, and both have the same base side effects.
String summary = str("revanced_spoof_video_streams_about_android_summary");
summary += '\n' + str("revanced_spoof_video_streams_about_kids_videos");
setTitle(str("revanced_spoof_video_streams_about_title"));
if (clientType == ClientType.VISIONOS) {
String summary = str(clientType == ClientType.IPADOS
? "revanced_spoof_video_streams_about_ipados_summary"
// visionOS has same base side effects as Android VR.
: "revanced_spoof_video_streams_about_android_summary");
if (clientType == ClientType.IPADOS) {
summary = str("revanced_spoof_video_streams_about_no_av1")
+ '\n' + summary;
} else if (clientType == ClientType.VISIONOS) {
summary = str("revanced_spoof_video_streams_about_experimental")
+ '\n' + summary
+ '\n' + str("revanced_spoof_video_streams_about_no_av1");
+ '\n' + str("revanced_spoof_video_streams_about_no_av1")
+ '\n' + str("revanced_spoof_video_streams_about_kids_videos");
} else {
summary += '\n' + str("revanced_spoof_video_streams_about_kids_videos");
}
setTitle(title);
setSummary(summary);
}
}