Skip to content

Commit

Permalink
Caption SErvice
Browse files Browse the repository at this point in the history
  • Loading branch information
honnuanand committed Dec 15, 2023
1 parent f1ee7dd commit 47e4142
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public void initialize(HttpRequest request) throws IOException {
for (Caption caption : captions) {
logger.info("Caption: " + caption.toString());
String captionLanguage = caption.getSnippet().getLanguage();
boolean isTrackDownloadable = caption.getSnippet().isTr;

YouTube.Captions.Download captionDownload = null;
try {
Expand Down Expand Up @@ -125,13 +124,13 @@ public String getAccessToken(String authCode) {
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(transport, jsonFactory,
clientSecrets, Arrays.asList("https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl"))
.setAccessType("offline")
.build();

// Exchange the authorization code for an access token
GoogleTokenResponse response = null;
try {
response = flow.newTokenRequest(authCode).setRedirectUri("http://localhost:3000").execute();

}
catch (TokenResponseException e) {
logger.error("Error getting access token: " + e.getDetails() + " " + e.getMessage());
Expand All @@ -143,7 +142,8 @@ public String getAccessToken(String authCode) {
// access token
}

logger.info("Access Token Response: " + response.toString());
logger.info("Access Token Response: " + response.getAccessToken());
logger.info("Refresh Token Response: " + response.getRefreshToken());

// Return the access token
return response.getAccessToken();
Expand Down

0 comments on commit 47e4142

Please sign in to comment.