Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6881265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:05:08+00:00 2026-05-27T05:05:08+00:00

I wanted to upload a video on youtube using Java Google Data API. I

  • 0

I wanted to upload a video on youtube using Java Google Data API. I got the following cod from the Google Data Api documentation to upload a video.The only thing i need to change in this code in Client ID and Porduct key. i am using followinf method to authenticate

YouTubeService service = new YouTubeService(clientID, developer_key);

Client key is my Google Email id , tried with with wasy,

  • only provided Username e,g. “sampleuser”
  • or complete Gmail id e.g. “sampleuser@gmail.com” or “smapleuser@googlemail.com”

i got developer key by logging my Google mail id as mentioned “smapleuser@googlemail.com”

but i always got following exception

com.google.gdata.util.AuthenticationException: Unauthorized
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:600)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
at com.google.gdata.client.media.MediaService.insert(MediaService.java:400)
at YouTube.videoUpload(YouTube.java:115)
at YouTube.main(YouTube.java:43)

here is my code for video Upload

YouTubeService service = new YouTubeService("sampleuser@gmail.com",
            "fakegoogleapplicationidjsuttoshowthatimgivingidhere");
    // YouTubeService service = new YouTubeService("My Application");
    VideoEntry newEntry = new VideoEntry();

    YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
    mg.setTitle(new MediaTitle());
    mg.getTitle().setPlainTextContent("My Test Movie");
    mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "Autos"));
    mg.setKeywords(new MediaKeywords());
    mg.getKeywords().addKeyword("cars");
    mg.getKeywords().addKeyword("funny");
    mg.setDescription(new MediaDescription());
    mg.getDescription().setPlainTextContent("My description");
    mg.setPrivate(false);
    mg.addCategory(new MediaCategory(YouTubeNamespace.DEVELOPER_TAG_SCHEME, "mydevtag"));
    mg.addCategory(new MediaCategory(YouTubeNamespace.DEVELOPER_TAG_SCHEME, "anotherdevtag"));

    newEntry.setGeoCoordinates(new GeoRssWhere(37.0,-122.0));
    // alternatively, one could specify just a descriptive string
    // newEntry.setLocation("Mountain View, CA");

    MediaFileSource ms = new MediaFileSource(new File("D:\\maths.mp4")
    , "video/quicktime");
    newEntry.setMediaSource(ms);

    // "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads";
    String uploadUrl =
        "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads";

    try {
        VideoEntry createdEntry = service.insert(new URL(uploadUrl), newEntry);
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (ServiceException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

please help , unable to find solution. thank you so much..looking for response

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:05:09+00:00Added an answer on May 27, 2026 at 5:05 am

    Try to add

    service.setUserCredentials("email_here", "password_here");

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Zend PHP Gdata API for Youtube to retrieve data and
Hi I wanted to upload images(along with other form details) and preview them, using
I'm using Uploadify and Kohana and I'm creating file uploader. User can upload only
in order to monitor the upload of large video files I'm using the progress
I wanted to find a way to upload a single file*, in the background,
I wanted to knw if there is way we can upload /download a blob;
I just wanted to know how to configure FCKEditor to upload files and images
I wanted to show the users Name Address (see www.ipchicken.com ), but the only
I wanted to generate one fix view using interface builder, but the size of
I wanted to design a simple site where one person can upload a file,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.