0
0
Fork 0
mirror of https://github.com/YTVanced/Integrations synced 2024-11-27 05:33:00 +00:00

don't add the vanced user agent for the channel details route

This commit is contained in:
caneleex 2022-02-24 22:47:57 +01:00
parent cb9006190f
commit c0ae51d29a

View file

@ -10,6 +10,8 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import fi.vanced.libraries.youtube.whitelisting.requests.WhitelistRoutes;
public class Requester {
private Requester() {}
@ -17,7 +19,9 @@ 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");
if (route != WhitelistRoutes.GET_CHANNEL_DETAILS) {
connection.setRequestProperty("User-agent", System.getProperty("http.agent") + ";vanced");
}
return connection;
}