YouTube CFC Updated
I've "formally" released the new version of my YouTube CFC to it's RIAForge home. This new version doesn't have a one to one relation to the older API so I've included the old code in the zip as well. Right now it supports:
- Various 'top' video feeds (most popular, etc)
- Videos by category, keyword, or both
- Videos by user
- Comments for a video
- Playlists for a user
- Videos for a playlist
And of course the big one - video upload.
The major things left to do include posting new comments and updating video information. Hopefully I can get the YouTube API Blog folks to notice.
Comments
I'm always concerned about timeouts / problems connecting to third party services - how would getVideos() tell the calling app "sorry, I couldn't contact the youtube website"
Could (should?) you change getVideos() to return a struct - one key has the results recordset, and one key has a "statuscode" message maybe?
Then put a timeout on the cfhttp call, and try/catch it?
just a thought...
# Posted By Geoff
| 4/20/08 6:40 AM
# Posted By Raymond Camden
| 4/20/08 8:42 AM
# Posted By Raymond Camden
| 4/20/08 8:45 AM
# Posted By Bob
| 4/20/08 9:35 AM
# Posted By Raymond Camden
| 4/20/08 6:10 PM
# Posted By Bob
| 4/20/08 9:19 PM
So I will add this later today.
# Posted By Raymond Camden
| 4/21/08 8:28 AM
trying the test2.cfm file in the youtubeapi1 folder and keep getting "Bad, unknown, or disabled dev_id specified."
i want to test the upload function and can't get started.
the cfc is installed and i have a valid dev key.
any advice or other documentation? where to start with uploads?
thanks!
# Posted By jason
| 6/23/08 11:06 PM
# Posted By Raymond Camden
| 6/24/08 2:50 AM
<cfset yt = createObject("component", "assets.cfcs.youtube")>
<cfset pl = yt.getVideosByUser('marjenningstv')>
any suggestions?
# Posted By Louis Plante
| 9/22/08 7:03 PM
FYI - upload is currently broken. I hope to have it fixed w/n a week. It turns out there is a bug in CF that only gets exposed with the YT api.
# Posted By Raymond Camden
| 9/22/08 7:48 PM
<cfinvoke component="youtube" method="init" returnvariable="yt"><cfinvokeargument name="devkey" value="#request.YouTubeDeveloperKey#"></cfinvoke>
<cfdump var="#yt.upload(video='#cffile.SERVERDIRECTORY#\#cffile.SERVERFILE#',title='Upload Test',description='Testing',categories='Education',keywords='YouTube ColdFusion')#">
Upload Result:
--------------
ErrorDetail: I/O Exception: Software caused connection abort: socket write error
Filecontent: Connection Failure
Mimetype: Unable to determine MIME type of file.
Statuscode: Connection Failure. Status code unavailable.
# Posted By Greg E.
| 10/13/08 5:12 PM
Long story short: You can't do the upload now- period. But you will be able to with a hotfix sometime in the (I would assume!) near future.
# Posted By Raymond Camden
| 10/13/08 5:17 PM
http://kb.adobe.com/selfservice/viewContent.do?ext...
but i get an error when trying to upload:
the error is in your cfc, trying to read an error.
can you give an example of the code needed to upload a video?
Element ERRORS.ERROR.DOMAIN.XMLTEXT is undefined in RESXML.
The error occurred in /home/mylifesp/dev_html/my-account/youtube.cfc: line 691
689 : <cfset resxml = xmlParse(result.fileContent)>
690 :
691 : <cfthrow message="YouTubeCFC Upload Error: Domain=#resxml.errors.error.domain.xmlText#, Code=#resxml.errors.error.code.xmlText#">
692 : <cfelse>
# Posted By aviva
| 11/30/08 4:29 PM
# Posted By Raymond Camden
| 11/30/08 4:40 PM
Both the Client ID and Developer Key should be provided in every API request (see Using a developer key and client ID). Each application/product should have its own unique Developer Key and Client ID.
http://code.google.com/apis/youtube/dashboard/prod...
Has it changed since the last update?
# Posted By Derek
| 12/22/08 9:27 AM
# Posted By Raymond Camden
| 12/22/08 9:36 AM
# Posted By Derek
| 12/22/08 9:37 AM
# Posted By Raymond Camden
| 12/22/08 9:40 AM
Everything was working at first. Then I started getting connection failures. I did some testing and by removing the V2 param, I got it working again.
So now the past couple of days it is no longer working on the prod server which is 7,0,2,142559 , but works fine on 8 from my home dev box.
Charset [empty string]
ErrorDetail Unknown host: gdata.youtube.com: gdata.youtube.com
Filecontent Connection Failure
Header [undefined struct element]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES
here is a test page I am using
http://justs10.com/videos/t.cfm
If anyone could help, be mucho appreciated.
Thanks,
D
# Posted By Derek
| 1/15/09 8:50 AM
# Posted By Raymond Camden
| 1/15/09 9:08 AM
# Posted By Raymond Camden
| 2/4/09 2:18 PM
<cfset yt = createObject("component", "youtube")>
<cfset yt.setDeveloperKey("AI39n2n17CzpcDAt6GMrXc8z6DA")>
<cfset yt.login("cfjedimaster", "password")>
<cfset r = yt.upload(expandPath('./actual.mov'),'Test/Upload Jack-O-Latern','Playing/with Jack-O-Latern youtube aug29','Music','testing fun')>
<cfoutput>id=#r#</cfoutput>
# Posted By Raymond Camden
| 2/4/09 2:22 PM

Regardless, this is really helpful - thank you!