Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3723

Do I have to Google Sign everytime to upload a Video to Youtbe using Java?

$
0
0
public static Credential authorize(final NetHttpTransport httpTransport) throws IOException {    InputStream in = new FileInputStream(CLIENT_SECRETS);    GoogleClientSecrets clientSecrets =    GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));    GoogleAuthorizationCodeFlow flow =    new GoogleAuthorizationCodeFlow.Builder(httpTransport, JSON_FACTORY, clientSecrets, SCOPES)        .setAccessType("offline")        .build();    int defaultPort = 5005;    LocalServerReceiver customReceiver = new LocalServerReceiver.Builder()        .setHost("localhost")        .setPort(defaultPort)        .build();    Credential credential = new AuthorizationCodeInstalledApp(flow, customReceiver).authorize("userid");    return credential;}public static YouTube getService() throws GeneralSecurityException, IOException {    final NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();    Credential credential = authorize(httpTransport);    return new YouTube.Builder(httpTransport, JSON_FACTORY, credential)        .setApplicationName(APPLICATION_NAME)        .build();}

So Everything works for me but i need to login everytime which I would prefer not doing. Is it possible to modify the code or anything else so it does that automaticly with given Email and password?


Viewing all articles
Browse latest Browse all 3723

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>