I”m getting a ProfileEntry for a logged in user. I’ve managed to get the username and such, but I’m having difficulty getting the users profile image. I see it in my browser when I goto http://gdata.youtube.com/feeds/api/users/iamryancoke under the element but I’m not sure how to access that with the C# implementation.
EDIT:
I’m using OAuth and here’s the code I’m trying to figure out how to get the thumbnail from this:
// Prepare YouTube request settings.
var settings = new YouTubeRequestSettings(youtubeSettings.AppName, youtubeSettings.DeveloperKey,
consumer.ConsumerKey, consumer.TokenManager.ConsumerSecret, accessToken, consumer.TokenManager.GetTokenSecret(accessToken),
youtubeSettings.User, MessagingUtilities.GetRequestUrlFromContext().StripQueryArgumentsWithPrefix("oauth_").ToString());
// Prepare YouTube request.
var youtubeRequest = new YouTubeRequest(settings);
var entry = youtubeRequest.Service.Get("http://gdata.youtube.com/feeds/api/users/default");;
return (ProfileEntry)entry;
I suppose you are using the Google Data API .NET client library.
http://code.google.com/p/google-gdata/
It took me some time to figure out where the thumbnail was hidden. They burried it pretty well, but you can retrieve the profile picture as follows:
Once you have the thumbnail URL to the profile picture you can use a simple web request to download and save the image.
A crude example: