Upload videos to Youtube from my web server in Java

前端 未结 2 1432
时光取名叫无心
时光取名叫无心 2021-02-10 13:49

My goal is to upload videos that are uploaded to my web server to Youtube on my own channel, not the users\' Youtube account (my web server is

2条回答
  •  情深已故
    2021-02-10 14:29

    I have have bypassed the whole AuthorizationCodeInstalledApp authorize() method and created a new subclass which bypasses the jetty server implementation process. The methods are as follows

    1. getAuthorizationFromStorage : Get access token from stored credentials.
    2. getAuthorizationFromGoogle : Get the authentication with the credentials from Google creates the url that will lead the user to the authentication page and creating a custom defined name-value pair in the state parameter. The value should be encoded with base64 encoder so we can receive the same code redirected from google after authentication.
    3. saveAuthorizationFromGoogle : Save the credentials that we get from google.

      • Create the GoogleAuthorizationCodeFlow object from the credentialDatastorfrom the response received from the google after authentication.
      • Hit google to get the permanent refresh-token that can be used to get the accesstoken of the user any time .
      • Store the tokens like accesstoken and refreshtoken in the filename as userid

    Checkout the code Implementation here

提交回复
热议问题