feat(youtube/return-youtube-dislike): decrease request timeout (#171)

This commit is contained in:
oSumAtrIX 2022-10-06 19:39:12 +02:00 committed by GitHub
parent f5a4e6f3bf
commit c372e0e9bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ public class ReturnYouTubeDislikeApi {
try {
LogHelper.debug(ReturnYouTubeDislikeApi.class, "Fetching dislikes for " + videoId);
HttpURLConnection connection = getConnectionFromRoute(ReturnYouTubeDislikeRoutes.GET_DISLIKES, videoId);
connection.setConnectTimeout(5 * 1000);
connection.setConnectTimeout(1000);
if (connection.getResponseCode() == 200) {
JSONObject json = getJSONObject(connection);
dislikeCount = json.getInt("dislikes");
@ -181,4 +181,4 @@ public class ReturnYouTubeDislikeApi {
private static JSONObject getJSONObject(HttpURLConnection connection) throws Exception {
return Requester.getJSONObject(connection);
}
}
}