views:

60

answers:

1

Is there any way to search playlists on youtube using gdata-python-client? As for documentation it is impossible, but may be there are some workarounds...

+1  A: 

The you tube python API seems to have a way of searching the playlists matching specific term. As per the documentation, API has the capability to retrieve a list of playlists matching a user-specified search term.

[Edit : Curl output]

I just used curl and the API seems to work fine.

~ $ curl 'http://gdata.youtube.com/feeds/api/playlists/snippets?q=soccer&start-index=11&max-results=10&v=2'

Output:

<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/&quot;C0cHRX85eCp7ImA9Wx5VEko.&quot;'><id>tag:youtube.com,2008:playlists:snippets</id><updated>2010-10-05T09:30:34.120Z</updated><category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#playlistLink'/&gt;&lt;title&gt;YouTube Playlists matching query: soccer</title><logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif&lt;/logo&gt;&lt;link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/snippets?v=2'/&gt;&lt;link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/snippets/batch?v=2'/&gt;&lt;link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/snippets?q=soccer&amp;amp;start-index=11&amp;amp;max-results=10&amp;amp;v=2'/&gt;&lt;link rel='service' type='application/atomsvc+xml' href='http://gdata.youtube.com/feeds/api/playlists/snippets?alt=atom-service&amp;amp;v=2'/&gt;&lt;link rel='previous' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/snippets?q=soccer&amp;amp;start-index=1&amp;amp;max-results=10&amp;amp;v=2'/&gt;&lt;link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/snippets?q=soccer&amp;amp;start-index=21&amp;amp;max-results=10&amp;amp;v=2'/&gt;&lt;author&gt;&lt;name&gt;YouTube&lt;/name&gt;&lt;uri&gt;http://www.youtube.com/&lt;/uri&gt;&lt;/author&gt;&lt;generator version='2.0' uri='http://gdata.youtube.com/'&gt;YouTube data API</generator><openSearch:totalResults>1241773</openSearch:totalResults><openSearch:startIndex>11</openSearch:startIndex><openSearch:itemsPerPage>10</openSearch:itemsPerPage></feed>~ $ 
pyfunc
Vladimir
@Vladimir: I used curl command and it seems to fetch the information.
pyfunc
You can open it via browser with same result, but there is no playlist entries nor any references to it besides totalResults...
Vladimir