Monday, March 28, 2011

[YouTube-API] Retrieving Playlist ID given a Playlist Feed

<?xml version='1.0' encoding='UTF-8'?>

<ns0:entry ns1:etag="W/&quot;Ck8MQX47eCp7ImA9WxRQEkQ.&quot;" xmlns:ns0="http://www.w3.org/2005/Atom" xmlns:ns1="http://schemas.google.com/g/2005">

<ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#playlistLink" />

<ns0:id>tag:youtube.com,2008:user:basit9008:playlist:FB10EDCB378F825E</ns0:id>

<ns0:author><ns0:name>basit9008</ns0:name><ns0:uri>http://gdata.youtube.com/feeds/api/users/basit9008</ns0:uri></ns0:author>

<ns0:content src="http://gdata.youtube.com/feeds/api/playlists/FB10EDCB378F825E?v=2" type="application/atom+xml;type=feed" />

<ns0:updated>2008-10-06T11:01:20.000Z</ns0:updated>

<ns0:published>2008-10-06T11:01:20.000Z</ns0:published>

<ns0:summary>11</ns0:summary>

<ns0:title>pak army</ns0:title>

<ns0:link href="http://gdata.youtube.com/feeds/api/users/basit9008?client=Web2.0&amp;v=2" rel="related" type="application/atom+xml" />

<ns0:link href="http://www.youtube.com/view_play_list?p=FB10EDCB378F825E" rel="alternate" type="text/html" />

<ns0:link href="http://gdata.youtube.com/feeds/api/users/basit9008/playlists/FB10EDCB378F825E?client=Web2.0&amp;v=2" rel="self" type="application/atom+xml" />

<ns2:countHint xmlns:ns2="http://gdata.youtube.com/schemas/2007">1</ns2:countHint>

<ns2:playlistId xmlns:ns2="http://gdata.youtube.com/schemas/2007">FB10EDCB378F825E</ns2:playlistId>

</ns0:entry>Hi,


I am accessing the following Playlist feed in Python : http://gdata.youtube.com/feeds/api/users/basit9008/playlists?v=2

I receive the attached file as a playlist entry. I would like to retrieve the playlist ID. In particular the element, 

<ns2:playlistId xmlns:ns2="http://gdata.youtube.com/schemas/2007">FB10EDCB378F825E</ns2:playlistId>

I can access the other entry elements by doing the following

   for playlist_entry in playlist_feed.entry:

        print playlist_entry.author[0].name.text

 

I am using YouTube Python API.

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment