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 6614887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:23:37+00:00 2026-05-25T20:23:37+00:00

Just started digging into the YouTube PHP API and got the browser-based Zend upload

  • 0

Just started digging into the YouTube PHP API and got the browser-based Zend upload script working. However, I can’t find any documentation on how to retrieve the status of the video after it’s been uploaded. The main reason I would need this is for error handling – I need to be able to know whether the video was approved by YouTube, since someone could technically upload an image or a file too large. I need to know that the vid was approved so that I know what message to display the end user when they return to the site (ie ‘Your video is live’ or ‘Video upload failed’).

The YouTube PHP browser-based upload returns a URL parameter status of 200 even if the format or size is incorrect, which is of course not helpful. Any ideas on how else to get this info from the YT object?

All in all, when a user returns to the site, I want to be able to create a YT object based on their specific video ID, and want to be able to confirm that it was not rejected. I’m using ClientLogin to initiate the YouTube obj:

$authenticationURL= 'https://www.google.com/accounts/ClientLogin';
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
              $username = 'myuser@gmail.com',
              $password = 'mypassword',
              $service = 'youtube',
              $client = null,
              $source = 'MySource', // a short string identifying your application
              $loginToken = null,
              $loginCaptcha = null,
              $authenticationURL);

Any thoughts?

  • 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-25T20:23:37+00:00Added an answer on May 25, 2026 at 8:23 pm

    Whew, finally found the answer to this after searching around and piecing together code for the last few days. After you create the $yt object, use the following to check the status:

    $yt->setMajorProtocolVersion(2);
    $youtubeEntry = $yt->getVideoEntry('YOUR_YOUTUBE_VID_ID', null, true);
    
    if ($youtubeEntry->getControl()){
        $control = $youtubeEntry->getControl();
        $state = $control->getState()->getName();
    }
    

    Echoing out $state displays the string 'failed' if the video was not approved for whatever reason. Otherwise it’s empty, which means it was approved and is good to go (Guessing the other state names would be: processing, rejected, failed, restricted, as Mient-jan Stelling suggested above).

    Crazy how tough this answer was to put together for first-time YouTube API’ers. Solved! (Pats self on back)

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

Sidebar

Related Questions

I have just started digging into JavaFX and have a requirement that I am
So I just started digging into web tech, and I'm stuck on the concept
I'm just digging a bit into Haskell and I started by trying to compute
Just started to realize an augmented reality based project, got GPS location, heading, and
Just started working with android and ran into a small problem. I am have
So I've just started digging into Objective-C, Cocoa, and iPhone development. I've ran into
Just started working with the Zend Framework Zf Tool and I've already come across
Please bear with me, I've just started digging into this whole CPU thing. The
Just started building an app with the zend framework. I've working on a zend
I just started digging into StructureMap and am running into some problems getting my

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.