Retrieving a user profile image in YouTube using Python

import gdata.youtube
import gdata.youtube.service

yt_service = gdata.youtube.service.YouTubeService()
user_entry = yt_service.GetYouTubeUserEntry(username='GoogleDevelopers')
print user_entry.thumbnail.url

9 comments:

  1. Well, it would be nice to post links to python libs...

    ReplyDelete
  2. Added some links to the right hand navigation. How's that look?

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. hey thanks....

    This is also useful link: http://code.google.com/apis/youtube/1.0/developers_guide_python.html for newbies...

    Thanks for the tips

    ReplyDelete
  5. Is it possible at all to ask for profile images when doing video searches so that more than just the username can be posted next the the video? Or even some version of "batch" where multiple profile images can be queried at once?

    ReplyDelete
  6. Not really an easy way of doing a batch request for an arbitrary set of user profiles.

    I would just render the page and have JavaScript retrieve the thumbnails dynamically by querying the user entry e.g.:

    http://picasaweb.google.com/data/entry/api/user/test.jfisher

    You probably want JSON-in-script though e.g.:

    http://picasaweb.google.com/data/entry/api/user/test.jfisher?alt=json-in-script&callback=handleProfileResponse

    Would be pretty easy to knock out with jQuery, just remember to set the callback to "?" in that case.

    ReplyDelete