mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-15 05:07:33 +01:00
fix(YouTube - Spoof video streams): Resolve playback of age restricted videos (#4096)
This commit is contained in:
parent
0501ba6724
commit
839a4045f1
@ -10,15 +10,17 @@ public enum ClientType {
|
|||||||
// Specific purpose for age restricted, or private videos, because the iOS client is not logged in.
|
// Specific purpose for age restricted, or private videos, because the iOS client is not logged in.
|
||||||
// https://dumps.tadiphone.dev/dumps/oculus/eureka
|
// https://dumps.tadiphone.dev/dumps/oculus/eureka
|
||||||
ANDROID_VR(28,
|
ANDROID_VR(28,
|
||||||
|
"ANDROID_VR",
|
||||||
"Quest 3",
|
"Quest 3",
|
||||||
"12",
|
"12",
|
||||||
"com.google.android.apps.youtube.vr.oculus/1.56.21 (Linux; U; Android 12; GB) gzip",
|
"com.google.android.apps.youtube.vr.oculus/1.56.21 (Linux; U; Android 12; GB) gzip",
|
||||||
"32", // Android 12.1
|
"32", // Android 12.1
|
||||||
"1.56.21",
|
"1.56.21",
|
||||||
true
|
true,
|
||||||
),
|
true),
|
||||||
// Specific for kids videos.
|
// Specific for kids videos.
|
||||||
IOS(5,
|
IOS(5,
|
||||||
|
"IOS",
|
||||||
forceAVC()
|
forceAVC()
|
||||||
? "iPhone12,5" // 11 Pro Max (last device with iOS 13)
|
? "iPhone12,5" // 11 Pro Max (last device with iOS 13)
|
||||||
: "iPhone16,2", // 15 Pro Max
|
: "iPhone16,2", // 15 Pro Max
|
||||||
@ -37,8 +39,22 @@ public enum ClientType {
|
|||||||
// but 17.40 is the last version that supports iOS 13.
|
// but 17.40 is the last version that supports iOS 13.
|
||||||
? "17.40.5"
|
? "17.40.5"
|
||||||
: "19.47.7",
|
: "19.47.7",
|
||||||
false
|
false,
|
||||||
);
|
true),
|
||||||
|
/**
|
||||||
|
* Android VR with no language code.
|
||||||
|
* Used for age restricted videos and YouTube Music to disable stable volume.
|
||||||
|
*/
|
||||||
|
ANDROID_VR_NO_HL(
|
||||||
|
ANDROID_VR.id,
|
||||||
|
ANDROID_VR.clientName,
|
||||||
|
ANDROID_VR.deviceModel,
|
||||||
|
ANDROID_VR.osVersion,
|
||||||
|
ANDROID_VR.userAgent,
|
||||||
|
ANDROID_VR.androidSdkVersion,
|
||||||
|
ANDROID_VR.clientVersion,
|
||||||
|
ANDROID_VR.canLogin,
|
||||||
|
false);
|
||||||
|
|
||||||
private static boolean forceAVC() {
|
private static boolean forceAVC() {
|
||||||
return BaseSettings.SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC.get();
|
return BaseSettings.SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC.get();
|
||||||
@ -50,6 +66,8 @@ public enum ClientType {
|
|||||||
*/
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
public final String clientName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device model, equivalent to {@link Build#MODEL} (System property: ro.product.model)
|
* Device model, equivalent to {@link Build#MODEL} (System property: ro.product.model)
|
||||||
*/
|
*/
|
||||||
@ -82,20 +100,28 @@ public enum ClientType {
|
|||||||
*/
|
*/
|
||||||
public final boolean canLogin;
|
public final boolean canLogin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a language code should be used.
|
||||||
|
*/
|
||||||
|
public final boolean useLanguageCode;
|
||||||
|
|
||||||
ClientType(int id,
|
ClientType(int id,
|
||||||
|
String clientName,
|
||||||
String deviceModel,
|
String deviceModel,
|
||||||
String osVersion,
|
String osVersion,
|
||||||
String userAgent,
|
String userAgent,
|
||||||
@Nullable String androidSdkVersion,
|
@Nullable String androidSdkVersion,
|
||||||
String clientVersion,
|
String clientVersion,
|
||||||
boolean canLogin
|
boolean canLogin,
|
||||||
) {
|
boolean useLanguageCode) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
this.clientName = clientName;
|
||||||
this.deviceModel = deviceModel;
|
this.deviceModel = deviceModel;
|
||||||
this.osVersion = osVersion;
|
this.osVersion = osVersion;
|
||||||
this.userAgent = userAgent;
|
this.userAgent = userAgent;
|
||||||
this.androidSdkVersion = androidSdkVersion;
|
this.androidSdkVersion = androidSdkVersion;
|
||||||
this.clientVersion = clientVersion;
|
this.clientVersion = clientVersion;
|
||||||
this.canLogin = canLogin;
|
this.canLogin = canLogin;
|
||||||
|
this.useLanguageCode = useLanguageCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,10 @@ final class PlayerRoutes {
|
|||||||
JSONObject context = new JSONObject();
|
JSONObject context = new JSONObject();
|
||||||
|
|
||||||
JSONObject client = new JSONObject();
|
JSONObject client = new JSONObject();
|
||||||
|
if (clientType.useLanguageCode) {
|
||||||
client.put("hl", BaseSettings.SPOOF_VIDEO_STREAMS_LANGUAGE.get().getIso639_1());
|
client.put("hl", BaseSettings.SPOOF_VIDEO_STREAMS_LANGUAGE.get().getIso639_1());
|
||||||
client.put("clientName", clientType.name());
|
}
|
||||||
|
client.put("clientName", clientType.clientName);
|
||||||
client.put("clientVersion", clientType.clientVersion);
|
client.put("clientVersion", clientType.clientVersion);
|
||||||
client.put("deviceModel", clientType.deviceModel);
|
client.put("deviceModel", clientType.deviceModel);
|
||||||
client.put("osVersion", clientType.osVersion);
|
client.put("osVersion", clientType.osVersion);
|
||||||
|
@ -1229,9 +1229,9 @@ This is because Crowdin requires temporarily flattening this file and removing t
|
|||||||
<string name="revanced_spoof_video_streams_ios_force_avc_summary_off">Video codec is determined automatically</string>
|
<string name="revanced_spoof_video_streams_ios_force_avc_summary_off">Video codec is determined automatically</string>
|
||||||
<string name="revanced_spoof_video_streams_ios_force_avc_user_dialog_message">Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, Opus audio codec is not available, and video playback will use more internet data than VP9 or AV1.</string>
|
<string name="revanced_spoof_video_streams_ios_force_avc_user_dialog_message">Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, Opus audio codec is not available, and video playback will use more internet data than VP9 or AV1.</string>
|
||||||
<string name="revanced_spoof_video_streams_about_ios_title">iOS spoofing side effects</string>
|
<string name="revanced_spoof_video_streams_about_ios_title">iOS spoofing side effects</string>
|
||||||
<string name="revanced_spoof_video_streams_about_ios_summary">• Private kids videos may not play\n• Age restricted videos may not play\n• Livestreams start from the beginning\n• Videos end 1 second early</string>
|
<string name="revanced_spoof_video_streams_about_ios_summary">• Private kids videos may not play\n• Livestreams start from the beginning\n• Videos end 1 second early</string>
|
||||||
<string name="revanced_spoof_video_streams_about_android_vr_title">Android VR spoofing side effects</string>
|
<string name="revanced_spoof_video_streams_about_android_vr_title">Android VR spoofing side effects</string>
|
||||||
<string name="revanced_spoof_video_streams_about_android_vr_summary">• Kids videos may not play\n• Age restricted videos may not play\n• Livestreams start from the beginning\n• Videos end 1 second early</string>
|
<string name="revanced_spoof_video_streams_about_android_vr_summary">• Kids videos may not play\n• Livestreams start from the beginning\n• Videos end 1 second early</string>
|
||||||
<string name="revanced_spoof_video_streams_language_title">Default audio stream language</string>
|
<string name="revanced_spoof_video_streams_language_title">Default audio stream language</string>
|
||||||
<string name="revanced_spoof_video_streams_language_DEFAULT">App language</string>
|
<string name="revanced_spoof_video_streams_language_DEFAULT">App language</string>
|
||||||
<string name="revanced_spoof_video_streams_language_AR">Arabic</string>
|
<string name="revanced_spoof_video_streams_language_AR">Arabic</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user