title: Problems connecting to YouTube Data API v3 using Java client library - sample code outdated?
body: <p>This is a very basic beginner question, but I checked the main API site (<a href="https://developers.google.com/youtube/v3/" rel="nofollow">https://developers.google.com/youtube/v3/</a>) pretty thoroughly and messed around for quite a frustrating while with the sample code, used Google to find other working examples and I came up with nothing so I decided to ask here.</p>
  
  <p>My aim is to write a simple Java program that connects to a YouTube account and retrieves the names and contents of the user's playlists, then possibly saves them to a text file or w/e.</p>
  
  <p>I didn't find much on the site to explain exactly what steps are involved in properly connecting to a YouTube account through Java, so I tried running some sample code. If I take this for example:
  <a href="https://developers.google.com/youtube/v3/code_samples/java#retrieve_my_uploads" rel="nofollow">https://developers.google.com/youtube/v3/code_samples/java#retrieve_my_uploads</a>
  And paste it into Eclipse, it tells me the following:</p>
  
  <ul>
  <li>The type "FileCredentialStore" is deprecated.</li>
  <li><p>At the following method:</p>
  
  <p><code>GoogleClientSecrets clientSecrets = GoogleClientSecrets.load( JSON_FACTORY,</code> <code>MyUploads.class.getResourceAsStream("/client_secrets.json"));</code></p></li>
  </ul>
  
  <p>It tells me:
  "The method load(JsonFactory, Reader) in the type GoogleClientSecrets is not applicable for the arguments (JsonFactory, InputStream)"</p>
  
  <p>A bit of Googling led me somewhere that suggested the method used in the example which uses an InputStream was deprecated and later removed in 1.16 I believe.</p>
  
  <ul>
  <li><p>Later the following error occurs:</p>
  
  <p><code>channelRequest.setMine("true");</code></p></li>
  </ul>
  
  <p>Where the String "true", should be the boolean value true. Again I'm assuming a previous version of that method was deprecated.</p>
  
  <p>I've tried messing around with it, trying to piece things together from Google but it hasn't worked at all. The code seems to be outdated and not to work with the latest version of the API, and most code I can find online seems old too. I don't know enough about what I'm doing and I can't find any documentation that actually outlines what steps are required, why, and how they work.
  For instance, I can't figure out what client_secrets.json is for and how it's supposed to be set up, beyond it being a part of authentication. If the API site explained it fully, I couldn't find where.</p>
  
  <p>Does anyone know of a site with some working up-to-date sample code that performs some simple connection and data retrieval? Or a proper step-by-step guide that explains how to connect?
  I would've thought something like the YouTube API would be straightforward and well-documented but I just can't get my head around it, unless I've missed something important but I'm out of ideas.</p>