syncr.app.youtube
index
/Users/jesse/src/python-local/syncr/app/youtube.py

 
Modules
       
xml.etree.ElementTree
datetime
time
urllib

 
Classes
       
YoutubeSyncr

 
class YoutubeSyncr
    YoutubeSyncr objects synchronize Youtube information with Django
via the GData API. The Youtube API requires no authentication, so
the construction method requires no parameters.
 
YoutubeSyncr creates four kinds of data in the Django database. These
are: Users, Videos, Playlists, and PlaylistVideos.
 
User: contains the profile information for a Youtube user
Video: contains the meta-data and URL information for a Youtube video
Playlist: contains a list of Video objects, with some meta-data
PlaylistVideo: a special Video object. See doc string for _syncPlaylistVideo
 
The Youtube API provides a wealth of data, easily accessible. Thus
this Syncr module is more sophisticated than the rest of django-syncr.
 
This app requires the excellent ElementTree, which is included in
Python 2.5. Otherwise available at:
http://effbot.org/zone/element-index.htm
 
  Methods defined here:
gtime2datetime(self, gtime)
Convert GData date and time to a Python datetime object.
syncPlaylist(self, playlist_id)
Synchronize a Youtube playlist based on playlist id
 
Required arguments
  playlist_id: a Youtube playlist id as a string
syncPlaylistFeed(self, playlist_feed)
Synchronize a Youtube playlist based on GData URL
 
Required arguments
  playlist_feed: a Youtube playlist GData feed URL
syncUser(self, username)
Synchronize a Youtube user profile based on username
 
Required arguments
  username: a Youtube username string.
syncUserFavorites(self, username)
Synchronize all favorite videos for a Youtube username
 
Required arguments
  username: a Youtube username as a string
syncUserFeed(self, user_feed)
Synchronize a Youtube user profile based on GData URL
 
Required arguments
  user_feed: a Youtube user GData feed URL
syncUserPlaylists(self, username)
Synchronize all playlists for a Youtube username.
 
Required arguments
  username: a Youtube username as a string
syncUserUploads(self, username)
Synchronize a user's uploads feed
 
Required arguments
  username: a Youtube username as a string
syncVideo(self, video_id)
Synchronize a Youtube video based on id
 
Required arguments
  video_id: a Youtube video id as a string
syncVideoFeed(self, video_feed)
Synchronize a Youtube video based on GData URL
 
Required arguments
  video_feed: a Youtube video GData feed URL

 
Data
        ATOM_NS = 'http://www.w3.org/2005/Atom'
GDATA_NS = 'http://schemas.google.com/g/2005'
MRSS_NS = 'http://search.yahoo.com/mrss/'
YOUTUBE_NS = 'http://gdata.youtube.com/schemas/2007'