mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-22 09:47:32 +01:00
fix 400
This commit is contained in:
parent
a3c40d10ce
commit
2ebad96acf
@ -28,14 +28,12 @@ import fi.vanced.utils.requests.Route;
|
|||||||
|
|
||||||
public class WhitelistRequester {
|
public class WhitelistRequester {
|
||||||
private static final String YT_API_URL = "https://www.youtube.com/youtubei/v1/";
|
private static final String YT_API_URL = "https://www.youtube.com/youtubei/v1/";
|
||||||
private static final String YT_API_KEY = "replaceMeWithTheYouTubeAPIKey";
|
|
||||||
|
|
||||||
private WhitelistRequester() {}
|
private WhitelistRequester() {}
|
||||||
|
|
||||||
public static void addChannelToWhitelist(WhitelistType whitelistType, View view, ImageView buttonIcon, Context context) {
|
public static void addChannelToWhitelist(WhitelistType whitelistType, View view, ImageView buttonIcon, Context context) {
|
||||||
try {
|
try {
|
||||||
HttpURLConnection connection = getConnectionFromRoute(WhitelistRoutes.GET_CHANNEL_DETAILS, YT_API_KEY);
|
HttpURLConnection connection = getConnectionFromRoute(WhitelistRoutes.GET_CHANNEL_DETAILS, "replaceMeWithTheYouTubeAPIKey");
|
||||||
connection.setRequestMethod("POST");
|
|
||||||
connection.setRequestProperty("Content-Type", "application/json; utf-8");
|
connection.setRequestProperty("Content-Type", "application/json; utf-8");
|
||||||
connection.setRequestProperty("Accept", "application/json");
|
connection.setRequestProperty("Accept", "application/json");
|
||||||
connection.setDoOutput(true);
|
connection.setDoOutput(true);
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package fi.vanced.libraries.youtube.whitelisting.requests;
|
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;
|
import fi.vanced.utils.requests.Route;
|
||||||
|
|
||||||
public class WhitelistRoutes {
|
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() {}
|
private WhitelistRoutes() {}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user