Tag: 服务帐户

Youtube Analytics和Google服务帐户

目标:实现一个程序(java或python)来检索我在Youtube频道上发布的video中的数据。 该计划将每天(凌晨1:00)推出。 解决方案:要检索数据Youtube,包括每天的观看次数,我认为YouTube Analytics API是最佳解决方案。 我使用Google帐户服务(“GoogleCredential”)对我进行身份validation: static { // Build service account credential. try { // Create a listener for automatic refresh OAuthAccessToken List list = new ArrayList(); list.add(new CredentialRefreshListener() { public void onTokenResponse(Credential credential, TokenResponse tokenResponse) throws IOException { System.out.println(tokenResponse.toPrettyString()); } public void onTokenErrorResponse(Credential credential, TokenErrorResponse tokenErrorResponse) throws IOException { System.err.println(“Error: ” + tokenErrorResponse.toPrettyString()); […]