YouTube API Errors

YouTube API returns videos when it feels like it.

Have a look at the YouTube.com
homepage today:
YouTube embedded player error on their homepage

^ What a black eye

An error occurred, please try again later.

I absolutely hate this error. Even the folks who made this Clash of the Titans campaign right on the YouTube homepage have this error. WTF. While it’s good to know that I’m not alone, this does not bode well for YouTube support. You’d think that this kind of major ad buy would help you get some kind of development assistance, especially if you’re on their homepage!

I rant because this error has plagued me this past month. I’ve used the Google AJAX Search API to embed videos, and the YouTube API to build a feed for a custom player. Both methods result in the same error, inconsistently.

When Flash upgraded their security in 2009, it basically broke a lot of cross domain functionality that we developers had relied on to serve-up content. And a simple crossdomain.xml file does not fix this error.

Jeff Posnick of the YouTube API team posted this note in a thread a while back. So the custom player was rewritten from scratch in AS3 in hopes that a supported version with the Security.allowDomain(”www.youtube.com”); method would work. After implementing these suggestions, still no luck.

YouTube API: It’s Not the Size That Counts

Another solution we tried was different sizes.
In testing, some videos wouldn’t play unless they were HD. Or 480p. Or 360p. But sometimes they wouldn’t play at all. Other times they would play only one size. But when retesting the videos, they would work with a different size! And some not at all… Then, we built size-checking into the player so that if it returned an error, it would request the next size. This method succeeded as much as it failed. So much for that approach.

In our testing we’ve gotten return errors of “0″ and “100″ meaning that the API thinks these videos are removed, banned or otherwise restricted by the user. In truth, they are not restricted, so there seems to be a disconnect between the requested video and what the API returns.

This error is so frustrating because it’s so inconsistent. And, yes, trying again later sometimes “fixes” it. But then, the other requested videos are broken. Right now I have no fix. I have videos that sometimes play. That is the best that you can get from the YouTube API.

I personally suspect that YouTube’s API and their CDN are not integrated as soundly as we think.


RE: 2x to “YouTube API Errors”

  1. LGee says:

    Did a tcpdump and here is my suggestion: Try appending the ‘www’ prefix to youtube.com in the URLs. Works for me so far.

    LGee

  2. Josh Knight says:

    Anyone had any luck figuring this out. I’ve tried adding the parameter format=5 and tried add filtering by using the restriction parameter, but I’m still – intermittently, I think – getting the “An error occurred, please try again later” message. At this point I’m just guessing… If you’ve come across any solutions, please, I’d love to hear about it.

Now Discuss