Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3759

I'm trying to get a youtube video's statistics like number of views, no of likes and no of comments but getting java.net.SocketTimeoutException error [duplicate]

$
0
0

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.


Viewing all articles
Browse latest Browse all 3759

Trending Articles