mirror of
https://github.com/revanced/revanced-integrations
synced 2024-11-19 13:57:14 +01:00
make sure to add vanced useragent
This commit is contained in:
parent
804dae3731
commit
b1a86abd34
@ -33,7 +33,6 @@ public class RYDRequester {
|
||||
Log.d(TAG, "Fetching dislikes for " + videoId);
|
||||
}
|
||||
HttpURLConnection connection = getConnectionFromRoute(RYDRoutes.GET_DISLIKES, videoId);
|
||||
connection.setRequestProperty("User-agent", System.getProperty("http.agent") + ";vanced");
|
||||
connection.setConnectTimeout(5 * 1000);
|
||||
if (connection.getResponseCode() == 200) {
|
||||
JSONObject json = getJSONObject(connection);
|
||||
@ -60,7 +59,6 @@ public class RYDRequester {
|
||||
public static String register(String userId, Registration registration) {
|
||||
try {
|
||||
HttpURLConnection connection = getConnectionFromRoute(RYDRoutes.GET_REGISTRATION, userId);
|
||||
connection.setRequestProperty("User-agent", System.getProperty("http.agent") + ";vanced");
|
||||
connection.setConnectTimeout(5 * 1000);
|
||||
if (connection.getResponseCode() == 200) {
|
||||
JSONObject json = getJSONObject(connection);
|
||||
@ -207,7 +205,6 @@ public class RYDRequester {
|
||||
// utils
|
||||
|
||||
private static void applyCommonRequestSettings(HttpURLConnection connection) throws Exception {
|
||||
connection.setRequestProperty("User-agent", System.getProperty("http.agent") + ";vanced");
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
|
@ -17,6 +17,7 @@ public class Requester {
|
||||
String url = apiUrl + route.compile(params).getCompiledRoute();
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||
connection.setRequestMethod(route.getMethod().name());
|
||||
connection.setRequestProperty("User-agent", System.getProperty("http.agent") + ";vanced");
|
||||
return connection;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user