mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-09-01 20:16:27 +02:00
feat(youtube/return-youtube-dislike): decrease request timeout (#171)
This commit is contained in:
parent
f5a4e6f3bf
commit
c372e0e9bd
@ -26,7 +26,7 @@ public class ReturnYouTubeDislikeApi {
|
|||||||
try {
|
try {
|
||||||
LogHelper.debug(ReturnYouTubeDislikeApi.class, "Fetching dislikes for " + videoId);
|
LogHelper.debug(ReturnYouTubeDislikeApi.class, "Fetching dislikes for " + videoId);
|
||||||
HttpURLConnection connection = getConnectionFromRoute(ReturnYouTubeDislikeRoutes.GET_DISLIKES, videoId);
|
HttpURLConnection connection = getConnectionFromRoute(ReturnYouTubeDislikeRoutes.GET_DISLIKES, videoId);
|
||||||
connection.setConnectTimeout(5 * 1000);
|
connection.setConnectTimeout(1000);
|
||||||
if (connection.getResponseCode() == 200) {
|
if (connection.getResponseCode() == 200) {
|
||||||
JSONObject json = getJSONObject(connection);
|
JSONObject json = getJSONObject(connection);
|
||||||
dislikeCount = json.getInt("dislikes");
|
dislikeCount = json.getInt("dislikes");
|
||||||
@ -181,4 +181,4 @@ public class ReturnYouTubeDislikeApi {
|
|||||||
private static JSONObject getJSONObject(HttpURLConnection connection) throws Exception {
|
private static JSONObject getJSONObject(HttpURLConnection connection) throws Exception {
|
||||||
return Requester.getJSONObject(connection);
|
return Requester.getJSONObject(connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user