Skip to content

Commit

Permalink
Fix playlists method to include authentication.
Browse files Browse the repository at this point in the history
  • Loading branch information
masterkain committed Jun 11, 2011
1 parent fdb2dd7 commit 6c60415
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/youtube_it/request/video_upload.rb
Expand Up @@ -302,12 +302,18 @@ def playlist(playlist_id)
end

def playlists
response = nil
playlist_url = "/feeds/api/users/default/playlists?v=2"
http_connection do |session|
response = session.get(playlist_url)
raise_on_faulty_response(response)
return response.body

if @access_token.nil?
http_connection do |session|
response = session.get(playlist_url)
end
else
response = @access_token.get("http://%s%s" % [base_url, playlist_url], authorization_headers_for_oauth)
end
raise_on_faulty_response(response)
return YouTubeIt::Parser::PlaylistsFeedParser.new(response).parse
end

def playlists_for(user)
Expand Down

0 comments on commit 6c60415

Please sign in to comment.