Examples of YouTubeApiHelper


Examples of com.google.ytd.youtube.YouTubeApiHelper

   *         null if the video could not be updated.
   */
  private VideoEntry updateVideoDescription(VideoSubmission videoSubmission,
      String prependText, String newTag) {

    YouTubeApiHelper userYouTubeApi = new YouTubeApiHelper(adminConfigDao);

    UserAuthToken userAuthToken = userAuthTokenDao
        .getUserAuthToken(videoSubmission.getYouTubeName());
    if (!userAuthToken.getAuthSubToken().isEmpty()) {
      userYouTubeApi.setAuthSubToken(userAuthToken.getAuthSubToken());
    } else {
      userYouTubeApi.setClientLoginToken(userAuthToken.getClientLoginToken());
    }

    String videoId = videoSubmission.getVideoId();
    LOG.info(String.format(
        "Updating description and tags of id '%s' (YouTube video id '%s').",
        videoSubmission.getId(), videoId));

    VideoEntry videoEntry = userYouTubeApi.getUploadsVideoEntry(videoId);
    if (videoEntry == null) {
      LOG.warning(String.format(
          "Couldn't get video with id '%s' in the uploads feed of user "
              + "'%s'. Perhaps the AuthSub token has been revoked?", videoId,
          videoSubmission.getYouTubeName()));
View Full Code Here

Examples of com.google.ytd.youtube.YouTubeApiHelper

      VideoEntry videoEntry = apiManager.getUploadsVideoEntry(videoId);
      if (videoEntry == null) {
        // Try an unauthenticated request to the specific user's uploads feed next.
        AdminConfig admin = adminConfigDao.getAdminConfig();
        String clientId = admin.getClientId();
        YouTubeApiHelper apiHelper = new YouTubeApiHelper(clientId);
        videoEntry = apiHelper.getUploadsVideoEntry(videoSubmission.getYouTubeName(), videoId);

        if (videoEntry == null) {
          // Fall back on looking for the video in the public feed.
          videoEntry = apiHelper.getVideoEntry(videoId);

          if (videoEntry == null) {
            // The video must have been deleted...
            LOG.info(String.format("Unable to find YouTube video id '%s'.", videoId));
            videoSubmission.setYouTubeState("NOT_FOUND");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.