From d20b768bc23d167d9f0d2c651c75b3f92944e731 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 25 Sep 2023 19:47:07 +0200 Subject: [PATCH] perf: Only request required fields --- .../spoof/requests/StoryBoardRendererRoutes.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/patches/spoof/requests/StoryBoardRendererRoutes.java b/app/src/main/java/app/revanced/integrations/patches/spoof/requests/StoryBoardRendererRoutes.java index f5fb11b6..3af7a11e 100644 --- a/app/src/main/java/app/revanced/integrations/patches/spoof/requests/StoryBoardRendererRoutes.java +++ b/app/src/main/java/app/revanced/integrations/patches/spoof/requests/StoryBoardRendererRoutes.java @@ -11,13 +11,19 @@ public final class StoryBoardRendererRoutes { private static final String YT_API_URL = "https://www.youtube.com/youtubei/v1/"; private static final String YT_API_KEY = "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w"; - static final Route GET_PLAYER_RESPONSE_BODY = new Route(Route.Method.POST, "player?key={api_key}"); + static final Route GET_STORYBOARD_SPEC = new Route( + Route.Method.POST, + "player" + + "?fields=storyboards.playerStoryboardSpecRenderer.spec," + + "storyboards.playerLiveStoryboardSpecRenderer.spec" + + "&key={api_key}" + ); private StoryBoardRendererRoutes() { } public static HttpURLConnection getPlayerResponseConnectionFromRoute() throws IOException { - var connection = Requester.getConnectionFromRoute(YT_API_URL, GET_PLAYER_RESPONSE_BODY, YT_API_KEY); + var connection = Requester.getConnectionFromRoute(YT_API_URL, GET_STORYBOARD_SPEC, YT_API_KEY); connection.setRequestProperty("User-Agent", "com.google.android.youtube/18.37.36 (Linux; U; Android 12; GB) gzip"); connection.setRequestProperty("X-Goog-Api-Format-Version", "2"); connection.setRequestProperty("Content-Type", "application/json");