First draft of new YouTube API

This post is more than 2 years old.

So not long after I had released my YouTubeCFC wrapper, Google dared to update the API to match the rest of their services. I didn't bother updating my code as I wanted to wait till upload support was done. YouTube now officially allows you to upload (and even update) videos.

I've begun work on rewriting my CFC. It supports basic reading (get top videos for example), but no searching yet. But I did get upload working. Here is an example of how easy it is:

<cfset yt = createObject("component", "youtube")> <cfset yt.setDeveloperKey("xxx")>

<cfset yt.login("cfjedimaster", "likeidsay")> <cfset r = yt.upload(expandPath('./'),'Test Upload','Playing with youtube','Music','testing,fun')> <cfoutput>id=#r#</cfoutput>

I've included the CFC for folks to play with, and once I get a bit more of the API done I'll replace the CFC at RIAForge.

You will need a valid login and a developer key. Also there seems to be a quota limit. I ran into after uploading about 10 videos.

Download attached file.

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

Archived Comments

Comment 1 by Jeff posted on 4/16/2008 at 8:22 AM

They DARED you? I think you should dare THEM to add CF support to Google App Engine.

(PS. Once again, nice work)

Comment 2 by Raul Riera posted on 4/16/2008 at 11:58 AM

CF support for the app engine, that would be something. :( If I could live off dreams...

Comment 3 by Sam posted on 4/17/2008 at 10:03 PM

Should I subscribe to Ray's channel?


Alright... Woo Hoo! First Subscriber! :-)

Comment 4 by Jason posted on 4/18/2008 at 7:47 AM

This page talks about the quotas with the API. There is a 1000 total limit for an account and in that case they recommend you add the video to the user's account. They also recommend passing the users IP in the restriction parameter.

Comment 5 by Frankie posted on 1/27/2009 at 9:36 PM

It's possible to upload video with this component?

Comment 6 by Raymond Camden posted on 1/27/2009 at 9:39 PM

Yes, please see http://youtubecfc.riaforge.... for the latest version.

Comment 7 by Frankie posted on 1/29/2009 at 8:45 PM

It seems that this require a hotfix to work....

In shared hosting it doesn't work...

It's true? or I have to change hosting?

Comment 8 by Raymond Camden posted on 1/29/2009 at 9:27 PM

You can always _ask_ your host to apply the hotfix. But if they won't, then no, you will have to change hosts.

Comment 9 by Frankie posted on 1/30/2009 at 11:59 PM

Hallo Ray,

Thanks for the reply...

I give them the link to the hotfix....

Another question is: how can I post comment?

Comment 10 by Raymond Camden posted on 1/31/2009 at 7:03 AM

While the API supports posting comments, my CFC does not (if I remember right). If you would like it, I could consider adding it, but no promise of when.

Comment 11 by Frankie posted on 2/1/2009 at 9:54 PM

Thank you, Ray...

Comment 12 by Richie Robles posted on 7/5/2011 at 11:15 PM

Do you have a working gui interface example?

Comment 13 by Raymond Camden posted on 7/5/2011 at 11:17 PM

Um - sorry what? A web site built using it? If so - no. This is just the wrapper. You don't want to use this file here btw - use the one on RIAForge.