My code is
YouTube youtube = new YouTube.Builder(httpTransport, jsonFactory, credential) .setApplicationName("youtube-cmdline-view-and-comments-updater").build(); System.out.println("starting checkpoint 3"); // Define the video id parameter String videoId = "VideoIDabc"; // Define the API request for retrieving the video statistics Videos.List request; System.out.println("starting checkpoint 4"); request.setId(videoId); VideoListResponse response = request.execute(); System.out.println("starting checkpoint 5");
and my output is Exception in thread "main" java.net.SocketTimeoutException: Connect timed out
and after printing starting checkpoint 4. starting checkpoint 5 never prints on console There is some problem in request.execute()
I am expecting video's stats but don't know what's wrong.