From b5e507c7a3718843469f7e366f96a53d279c28a0 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:04:28 +0900 Subject: [PATCH] feat(YouTube - Spoof streaming data): Remove `Skip iOS livestream playback` setting (no longer needed) --- .../spoof/requests/StreamingDataRequest.java | 13 +------------ .../extension/shared/settings/BaseSettings.java | 1 - .../youtube/settings/xml/revanced_prefs.xml | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/extensions/shared/src/main/java/app/revanced/extension/shared/patches/spoof/requests/StreamingDataRequest.java b/extensions/shared/src/main/java/app/revanced/extension/shared/patches/spoof/requests/StreamingDataRequest.java index 0e9f8c76b..4cd28fa7f 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/shared/patches/spoof/requests/StreamingDataRequest.java +++ b/extensions/shared/src/main/java/app/revanced/extension/shared/patches/spoof/requests/StreamingDataRequest.java @@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import app.revanced.extension.shared.patches.components.ByteArrayFilterGroup; import app.revanced.extension.shared.patches.client.AppClient.ClientType; import app.revanced.extension.shared.utils.Logger; @@ -44,12 +43,6 @@ public class StreamingDataRequest { "X-GOOG-API-FORMAT-VERSION", "X-Goog-Visitor-Id" }; - private static final ByteArrayFilterGroup liveStreams = - new ByteArrayFilterGroup( - BaseSettings.SPOOF_STREAMING_DATA_IOS_SKIP_LIVESTREAM_PLAYBACK, - "yt_live_broadcast", - "yt_premiere_broadcast" - ); private static ClientType lastSpoofedClientType; @@ -193,15 +186,11 @@ private static ByteBuffer fetch(String videoId, Map playerHeader try (InputStream inputStream = new BufferedInputStream(connection.getInputStream()); ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - byte[] buffer = new byte[4096]; + byte[] buffer = new byte[2048]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) >= 0) { baos.write(buffer, 0, bytesRead); } - if (clientType == ClientType.IOS && liveStreams.check(buffer).isFiltered()) { - Logger.printDebug(() -> "Ignore IOS spoofing as it is a livestream (video: " + videoId + ")"); - continue; - } lastSpoofedClientType = clientType; return ByteBuffer.wrap(baos.toByteArray()); diff --git a/extensions/shared/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java b/extensions/shared/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java index fd272a338..1c991612e 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java +++ b/extensions/shared/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java @@ -41,7 +41,6 @@ public class BaseSettings { public static final BooleanSetting SPOOF_STREAMING_DATA = new BooleanSetting("revanced_spoof_streaming_data", TRUE, true, "revanced_spoof_streaming_data_user_dialog_message"); public static final EnumSetting SPOOF_STREAMING_DATA_TYPE = new EnumSetting<>("revanced_spoof_streaming_data_type", SpoofStreamingDataDefaultClient(), true); - public static final BooleanSetting SPOOF_STREAMING_DATA_IOS_SKIP_LIVESTREAM_PLAYBACK = new BooleanSetting("revanced_spoof_streaming_data_ios_skip_livestream_playback", TRUE, true); public static final BooleanSetting SPOOF_STREAMING_DATA_STATS_FOR_NERDS = new BooleanSetting("revanced_spoof_streaming_data_stats_for_nerds", TRUE); /** diff --git a/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 226779d86..e8f75527f 100644 --- a/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -783,7 +783,6 @@ - SETTINGS: SPOOF_STREAMING_DATA -->