UploadError: Invalid request URI: invalidRequestUri #132

Closed
zachfeldman opened this Issue Oct 25, 2012 · 2 comments

Projects

None yet

2 participants

@zachfeldman

Trying to update a playlist and getting this error. Any ideas on how to troubleshoot? Am I able to print the entire youtube API response so I can see what it contains?

I'm running on Heroku's Cedar Stack. The weird thing is that everything works perfectly from my local setup but as soon as I try it on Heroku I get this error.

@zachfeldman

A bit more information: this is happening when I try to clear out the videos in a playlist before adding new ones as well as when creating a new playlist.

Here's my clear code:

client = YouTubeIt::Client.new(:username => get_yt_user(), :password =>  get_yt_pass(), :dev_key => get_dev_key())

    playlist = client.playlist(yt_playlist_id)

    playlist.videos.each do |video| 
        playlist_entry_id = video.video_id.split(":").last
        client.delete_video_from_playlist(yt_playlist_id, playlist_entry_id)
    end

And here's my create code:

client = YouTubeIt::Client.new(:username => get_yt_user(), :password => get_yt_pass(), :dev_key => get_dev_key())

    playlist = client.add_playlist(:title => playlist_title, :description => playlist_description)

    playlistXmlDecoded = XmlSimple.xml_in(playlist.xml)

    video_ids.each do |video_id|

                video_id = Video.first(:id => video_id).youtube_id  
                client.add_video_to_playlist(playlistXmlDecoded["playlistId"], video_id)

    end

    playlistXmlDecoded["playlistId"][0]
@chebyte
Collaborator
chebyte commented Jan 9, 2013

please check your code again, I just tried adding a new playlis, updating and new video and works perfect

playlist = client.add_playlist(:title => "youtube_it test!", :description => "test playlist")
video = client.add_video_to_playlist(playlist.playlist_id,"CE62FSEoY28")

and returns ok

{:code=>201, :body=>"<?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:app='http://www.w3.org/2007/app' xmlns:media='http://search.yahoo.com/mrss/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007' gd:etag='W/&quot;YDwqeyM.&quot;'><id>tag:youtube.com,2008:playlist:PLUq7irMdoCZITNM5ZCRwpH4-2Qww1Ol62:PLQFFVwEah2EOhMdugvXSs5iy8-PqUc1NTlCqwBYPs9rw</id><published>2013-01-09T20:21:49.000Z</published><updated>1970-01-01T00:00:00.000Z</updated><app:edited>1970-01-01T00:00:00.000Z</app:edited><category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/><category scheme='http://gdata.youtube.com/schemas/2007/categories.cat' term='People' label='People &amp; Blogs'/><title>Tuquito ClassmatePC 3 - Touch Screen</title><content type='application/x-shockwave-flash' src='http://www.youtube.com/v/CE62FSEoY28?version=3&amp;f=playlists&amp;c=youtube_it&amp;d=AcvHVrjNl-u4ur-FKcRzbx8O88HsQjpE1a8d1GxQnGDm&amp;app=youtube_gdata'/><link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=CE62FSEoY28&amp;feature=youtube_gdata'/><link rel='http://gdata.youtube.com/schemas/2007#video.responses' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/CE62FSEoY28/responses?client=youtube_it'/><link rel='http://gdata.youtube.com/schemas/2007#video.ratings' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/CE62FSEoY28/ratings?client=youtube_it'/><link rel='http://gdata.youtube.com/schemas/2007#video.complaints' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/CE62FSEoY28/complaints?client=youtube_it'/><link rel='http://gdata.youtube.com/schemas/2007#video.related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/CE62FSEoY28/related?client=youtube_it'/><link rel='http://gdata.youtube.com/schemas/2007#mobile' type='text/html' href='http://m.youtube.com/details?v=CE62FSEoY28'/><link rel='http://gdata.youtube.com/schemas/2007#uploader' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/9m4qThg_zsMLscTUP9FeSQ?client=youtube_it'/><link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/CE62FSEoY28?client=youtube_it'/><link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/PLUq7irMdoCZITNM5ZCRwpH4-2Qww1Ol62/PLQFFVwEah2EOhMdugvXSs5iy8-PqUc1NTlCqwBYPs9rw?client=youtube_it'/><link rel='edit' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/playlists/PLUq7irMdoCZITNM5ZCRwpH4-2Qww1Ol62/PLQFFVwEah2EOhMdugvXSs5iy8-PqUc1NTlCqwBYPs9rw?client=youtube_it'/><author><name>tubeit20101</name><uri>http://gdata.youtube.com/feeds/api/users/tubeit20101</uri><yt:userId>WWmLvppy3j64IGmA2dpCyw</yt:userId></author><yt:accessControl action='comment' permission='allowed'/><yt:accessControl action='commentVote' permission='allowed'/><yt:accessControl action='videoRespond' permission='moderated'/><yt:accessControl action='rate' permission='allowed'/><yt:accessControl action='embed' permission='allowed'/><yt:accessControl action='list' permission='allowed'/><yt:accessControl action='autoPlay' permission='allowed'/><yt:accessControl action='syndicate' permission='allowed'/><gd:comments><gd:feedLink rel='http://gdata.youtube.com/schemas/2007#comments' href='http://gdata.youtube.com/feeds/api/videos/CE62FSEoY28/comments?client=youtube_it' countHint='8'/></gd:comments><media:group><media:category label='People &amp; Blogs' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>People</media:category><media:content url='http://www.youtube.com/v/CE62FSEoY28?version=3&amp;f=playlists&amp;c=youtube_it&amp;d=AcvHVrjNl-u4ur-FKcRzbx8O88HsQjpE1a8d1GxQnGDm&amp;app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='331' yt:format='5'/><media:content url='rtsp://v6.cache2.c.youtube.com/ClQLENy73wIaSwlvYyghFbZOCBMYDSANFEIKeW91dHViZV9pdEgGUglwbGF5bGlzdHNyIQHLx1a4zZfruLq_hSnEc28fDvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='331' yt:format='1'/><media:content url='rtsp://v6.cache2.c.youtube.com/ClQLENy73wIaSwlvYyghFbZOCBMYESARFEIKeW91dHViZV9pdEgGUglwbGF5bGlzdHNyIQHLx1a4zZfruLq_hSnEc28fDvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='331' yt:format='6'/><media:credit role='uploader' scheme='urn:youtube' yt:display='chebyte'>chebyte</media:credit><media:description type='plain'>videocast de Tuquito ClassmatePC 3 TOUCH SCREEN</media:description><media:keywords/><media:license type='text/html' href='http://www.youtube.com/t/terms'>youtube</media:license><media:player url='http://www.youtube.com/watch?v=CE62FSEoY28&amp;feature=youtube_gdata_player'/><media:thumbnail url='http://i.ytimg.com/vi/CE62FSEoY28/default.jpg' height='90' width='120' time='00:02:45.500' yt:name='default'/><media:thumbnail url='http://i.ytimg.com/vi/CE62FSEoY28/mqdefault.jpg' height='180' width='320' yt:name='mqdefault'/><media:thumbnail url='http://i.ytimg.com/vi/CE62FSEoY28/hqdefault.jpg' height='360' width='480' yt:name='hqdefault'/><media:thumbnail url='http://i.ytimg.com/vi/CE62FSEoY28/1.jpg' height='90' width='120' time='00:01:22.750' yt:name='start'/><media:thumbnail url='http://i.ytimg.com/vi/CE62FSEoY28/2.jpg' height='90' width='120' time='00:02:45.500' yt:name='middle'/><media:thumbnail url='http://i.ytimg.com/vi/CE62FSEoY28/3.jpg' height='90' width='120' time='00:04:08.250' yt:name='end'/><media:title type='plain'>Tuquito ClassmatePC 3 - Touch Screen</media:title><yt:duration seconds='331'/><yt:uploaded>2009-10-18T23:02:02.000Z</yt:uploaded><yt:uploaderId>UC9m4qThg_zsMLscTUP9FeSQ</yt:uploaderId><yt:videoid>CE62FSEoY28</yt:videoid></media:group><gd:rating average='3.857143' max='5' min='1' numRaters='7' rel='http://schemas.google.com/g/2005#overall'/><yt:statistics favoriteCount='0' viewCount='1915'/><yt:rating numDislikes='2' numLikes='5'/><yt:position>1</yt:position></entry>", :playlist_entry_id=>"PLQFFVwEah2EOhMdugvXSs5iy8-PqUc1NTlCqwBYPs9rw"}
@chebyte chebyte closed this Jan 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment