问题
I need to get the Video Ids from a YouTube Playlist.
e.g.: Thats our demo playlist: http://www.youtube.com/playlist?list=PL8B03F998924DA45B
That's my c# code:
SyndicationFeed feed = await client.RetrieveFeedAsync("https://gdata.youtube.com/feeds/api/playlists/PL8B03F998924DA45B?v=2");
I then can not find the IDs of the single videos from the playlist in my feed
object. Any Ideas?
回答1:
I suggest you to use Data API v3. Data API is the one that reflects playlists in YouTube and highly supported.
In v3, you will do a playlistItems->list call with setting the playlistId.
In the response, if the playlist item is a video, you can get videoId from either snippet.resourceId.videoId or contentDetails.videoId
You can find C# examples here.
来源:https://stackoverflow.com/questions/18694568/get-video-id-from-a-youtube-playlist