0

I have the url working in browser that returns the JSON result of the query that gets information about the Youtube Video but don't understand how i can use the Youtube Data API to pass this JSON and look at the information.

Here is the code i am using:

        YouTubeService service = new YouTubeService("app");
            //service.setUserCredentials("xxx","xxxxxx");
            String videoEntryUrl = String.format("https://www.googleapis.com/youtube/v3/videos?key=%s&part=snippet&id=%s"
                    , Config.YOUTUBE_API_KEY , (String) params[0]);
            VideoEntry videoEntry = service.g.getEntry(new URL(videoEntryUrl), VideoEntry.class);

The API key i have created is a Browser Key, so the data is formatted in JSON.

Also the error i recieve is:

com.google.gdata.util.ParseException: Unrecognized content type:application/json;charset=UTF-8
redoc01
  • 2,107
  • 5
  • 32
  • 64

1 Answers1

0

I think you should use the YouTube Data API Client Library for Java for your Youtube implementation. Note the following operations that you can use:

  • list
  • insert
  • update
  • delete

With this, there is no operation for a specific video but you can use list operation instead.

You can use these links for more information:

https://developers.google.com/api-client-library/java/apis/youtube/v3 https://developers.google.com/youtube/v3/code_samples/

Also, here's an item that you can refer to.

Community
  • 1
  • 1
rod
  • 21