YouTube API for Python
NOTE: This is pretty old, doesn't work with the new GData API and was a little kludgy to begin with. I recommend not using it. Try the gdata-python-client instead. Thought this does not yet have a Youtube specific module, with some effort it can do quite a bit of processing. Also, you might be interested in the django-syncr tool.
I wanted to use the YouTube API a few weeks back for a project I'm working on, but after prowling around the Internet, I couldn't find any Python library that implements it (something like flickr.py). So I wrote my own.
If you'd like to use it, you can download utubeapi.py here. Please let me know if it's helpful and maybe I'll put it someplace with more permanence.
A few notes: first, this requires you install ElementTree. There are usage examples at the beginning of the source file. You can use the API directly by creating a UTubeAPI object, with your developer id as a constructor parameter, and calling the appropriate methods. These methods return dictionaries of the response data.
Or you can also access the API indirectly with UTubeVideo, UTubeUser, or UTubePlaylist. These take a UTubeAPI object and an id string as constructor parameters. They create objects with the YouTube information stored as member data. For example, UTubeUser downloads the user profile and has methods to retrieve the friends list, uploads list, and favorites list.
All API calls are made using the REST interface and there is a built-in one second delay between calls.
blog comments powered by Disqus