Closed masterkain closed 12 years ago
hi there can you show me a better example, what query did you make?
thanks
@video = youtube_client.videos_by(categories: { either: [:music, :video] }, racy: true, only_embeddable: true, query: "immortal live", max_results: 1).videos.first
if you remove the racy param it works, otherwise it bombs:
OpenURI::HTTPError: 400
from /Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/youtube_it-2.0.1/lib/youtube_it/parser.rb:8:in `rescue in initialize'
from /Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/youtube_it-2.0.1/lib/youtube_it/parser.rb:5:in `initialize'
from /Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/youtube_it-2.0.1/lib/youtube_it/client.rb:74:in `new'
from /Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/youtube_it-2.0.1/lib/youtube_it/client.rb:74:in `videos_by'
thanks for this
you problem is that racy just allows the options include or exclude not TRUE
but we have another problem, racy was replaced by safeSearch param in the version 2 of api
I going to add this fix now cause we are using v2
thanks for this report!
ok I added the new way now you can use safe_search with the follows options : none, strict, moderate
@video = youtube_client.videos_by(categories: { either: [:music, :video] }, safe_search: "none", only_embeddable: true, query: "immortal live", max_results: 1).videos.first
you can wait for the next release or use the code from github
cheers!
awesome @chebyte , thanks!
Hi, when doing a
videos_by
search if I specify aracy: 'include'
as option I get an exception returning HTTP status 400.