Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

video_by(id) fails if video is private #120

Closed
muffl0n opened this Issue · 1 comment

1 participant

@muffl0n

When trying to fetch a private video by id the request fails:

client = YouTubeIt::Client.new(:username => user, :password => password :dev_key => dev_key)

id = ARGV[0]
video = client.video_by(id)
/home/muffl0n/.gem/ruby/1.8/gems/youtube_it-2.1.7/lib/youtube_it/parser.rb:10:in `initialize': 403 (OpenURI::HTTPError)
        from /home/muffl0n/.gem/ruby/1.8/gems/youtube_it-2.1.7/lib/youtube_it/client.rb:97:in `new'
        from /home/muffl0n/.gem/ruby/1.8/gems/youtube_it-2.1.7/lib/youtube_it/client.rb:97:in `video_by'
        from youtube.rb:7

The URL youtube_it calls is

http://gdata.youtube.com/feeds/api/videos/<id>?v=2&key=<dev_key>

When I switch the video to public everything works fine.

The Youtube-API-Documentation (https://developers.google.com/youtube/2.0/reference#youtubeDataAPIFeedTypes) says:

Private, pending and rejected videos would not appear in a response to an unauthorized API request or a request for videos uploaded by someone other than the currently authenticated user.

So it seems that the API call doesn't know about the user I logged in with in the script.

@muffl0n

It's not bug. The documentation for the methods to retrieve private videos was just missing. See #122 for pull request.

@muffl0n muffl0n closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.