動画をyoutubeにアップロードする必要があります。だから、私はjava google libを使用していることを認証する必要があります。サーバーからのGoogle認証
Credential credential = new GoogleCredential.Builder()
.setTransport(new ApacheHttpTransport())
.setJsonFactory(new JacksonFactory())
.setServiceAccountId("[email protected]")
.setClientSecrets("[email protected]", "xx")
.setServiceAccountPrivateKeyFromP12File(new File("xx.p12"))
.setServiceAccountScopes(scopes)
.setServiceAccountUser("[email protected]")
.build();
youtube = new YouTube.Builder(credential.getTransport(), credential.getJsonFactory(), credential).setApplicationName(
"tellews-app").build();
Video returnedVideo = videoInsert.execute();
YouTube.Videos.Insert videoInsert = youtube.videos()
.insert("snippet,statistics,status", videoObjectDefiningMetadata, mediaContent);
Video returnedVideo = videoInsert.execute();
し、エラーを取得::コードは次のようになります
IOException: 401 Unauthorized { "error" : "unauthorized_client", "error_description" : "Client is unauthorized to retrieve access tokens using this method." }
たぶん誰かが私が間違って