From 2ebad96acff83d556c57e7d9aa0fe030af21421b Mon Sep 17 00:00:00 2001 From: caneleex Date: Mon, 24 Jan 2022 12:47:32 +0100 Subject: [PATCH] fix 400 --- .../youtube/whitelisting/requests/WhitelistRequester.java | 4 +--- .../youtube/whitelisting/requests/WhitelistRoutes.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRequester.java b/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRequester.java index 2d8b0058..65f682d1 100644 --- a/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRequester.java +++ b/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRequester.java @@ -28,14 +28,12 @@ import fi.vanced.utils.requests.Route; public class WhitelistRequester { private static final String YT_API_URL = "https://www.youtube.com/youtubei/v1/"; - private static final String YT_API_KEY = "replaceMeWithTheYouTubeAPIKey"; private WhitelistRequester() {} public static void addChannelToWhitelist(WhitelistType whitelistType, View view, ImageView buttonIcon, Context context) { try { - HttpURLConnection connection = getConnectionFromRoute(WhitelistRoutes.GET_CHANNEL_DETAILS, YT_API_KEY); - connection.setRequestMethod("POST"); + HttpURLConnection connection = getConnectionFromRoute(WhitelistRoutes.GET_CHANNEL_DETAILS, "replaceMeWithTheYouTubeAPIKey"); connection.setRequestProperty("Content-Type", "application/json; utf-8"); connection.setRequestProperty("Accept", "application/json"); connection.setDoOutput(true); diff --git a/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRoutes.java b/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRoutes.java index 41d2f11c..609105bc 100644 --- a/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRoutes.java +++ b/app/src/main/java/fi/vanced/libraries/youtube/whitelisting/requests/WhitelistRoutes.java @@ -1,11 +1,11 @@ package fi.vanced.libraries.youtube.whitelisting.requests; -import static fi.vanced.utils.requests.Route.Method.GET; +import static fi.vanced.utils.requests.Route.Method.POST; import fi.vanced.utils.requests.Route; public class WhitelistRoutes { - public static final Route GET_CHANNEL_DETAILS = new Route(GET, "player?key={api_key}"); + public static final Route GET_CHANNEL_DETAILS = new Route(POST, "player?key={api_key}"); private WhitelistRoutes() {} } \ No newline at end of file