mamuso / acts_as_unvlogable

An easy way to include external video services in a rails app.
MIT License
143 stars 31 forks source link

Unsuported url or service #21

Closed pacuna closed 9 years ago

pacuna commented 9 years ago

Hi, I'm using the latest version and I'm getting this error when trying to use youtube urls (I have the google api key in the config).

Gem Tests are also failing

[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
..FF..FF..FF...........................

Failures:

  1) UnvlogIt with an existent youtube url initialize a VgYoutube instance
     Failure/Error: let(:videotron) { UnvlogIt.new("http://www.youtube.com/watch?v=MVa4q-YVjD8", {:key => "AIzaSyCWdV1zQpyD1X1OdheU6UqfV3JR6JQXY9A" }) } # => Keith Moon??s drum kit explodes
     ArgumentError:
       Unsuported url or service
     # ./lib/acts_as_unvlogable/vg_youtube.rb:20:in `rescue in initialize'
     # ./lib/acts_as_unvlogable/vg_youtube.rb:16:in `initialize'
     # ./lib/acts_as_unvlogable.rb:103:in `new'
     # ./lib/acts_as_unvlogable.rb:103:in `service_object'
     # ./lib/acts_as_unvlogable.rb:86:in `load_service'
     # ./lib/acts_as_unvlogable.rb:26:in `initialize'
     # ./spec/acts_as_unvlogable_spec.rb:22:in `new'
     # ./spec/acts_as_unvlogable_spec.rb:22:in `block (3 levels) in <top (required)>'
     # ./spec/acts_as_unvlogable_spec.rb:25:in `block (3 levels) in <top (required)>'

  2) UnvlogIt with an existent youtube url returns the video properties
     Failure/Error: let(:videotron) { UnvlogIt.new("http://www.youtube.com/watch?v=MVa4q-YVjD8", {:key => "AIzaSyCWdV1zQpyD1X1OdheU6UqfV3JR6JQXY9A" }) } # => Keith Moon??s drum kit explodes
     ArgumentError:
       Unsuported url or service
     # ./lib/acts_as_unvlogable/vg_youtube.rb:20:in `rescue in initialize'
     # ./lib/acts_as_unvlogable/vg_youtube.rb:16:in `initialize'
     # ./lib/acts_as_unvlogable.rb:103:in `new'
     # ./lib/acts_as_unvlogable.rb:103:in `service_object'
     # ./lib/acts_as_unvlogable.rb:86:in `load_service'
     # ./lib/acts_as_unvlogable.rb:26:in `initialize'
     # ./spec/acts_as_unvlogable_spec.rb:22:in `new'
     # ./spec/acts_as_unvlogable_spec.rb:22:in `block (3 levels) in <top (required)>'
     # ./spec/acts_as_unvlogable_spec.rb:348:in `check_video_attributes'
     # ./spec/acts_as_unvlogable_spec.rb:32:in `block (3 levels) in <top (required)>'

  3) UnvlogIt with a shortened youtube URL initialize a VgYoutube instance
     Failure/Error: let(:videotron) { UnvlogIt.new("http://youtu.be/4pzMBtPMUq8", {:key => "AIzaSyCWdV1zQpyD1X1OdheU6UqfV3JR6JQXY9A" }) } # => Keith Moon??s drum kit explodes
     ArgumentError:
       Unsuported url or service
     # ./lib/acts_as_unvlogable/vg_youtube.rb:20:in `rescue in initialize'
     # ./lib/acts_as_unvlogable/vg_youtube.rb:16:in `initialize'
     # ./lib/acts_as_unvlogable/vg_youtu.rb:9:in `initialize'
     # ./lib/acts_as_unvlogable.rb:103:in `new'
     # ./lib/acts_as_unvlogable.rb:103:in `service_object'
     # ./lib/acts_as_unvlogable.rb:86:in `load_service'
     # ./lib/acts_as_unvlogable.rb:26:in `initialize'
     # ./spec/acts_as_unvlogable_spec.rb:49:in `new'
     # ./spec/acts_as_unvlogable_spec.rb:49:in `block (3 levels) in <top (required)>'
     # ./spec/acts_as_unvlogable_spec.rb:52:in `block (3 levels) in <top (required)>'

  4) UnvlogIt with a shortened youtube URL returns the video properties
     Failure/Error: let(:videotron) { UnvlogIt.new("http://youtu.be/4pzMBtPMUq8", {:key => "AIzaSyCWdV1zQpyD1X1OdheU6UqfV3JR6JQXY9A" }) } # => Keith Moon??s drum kit explodes
     ArgumentError:
       Unsuported url or service
     # ./lib/acts_as_unvlogable/vg_youtube.rb:20:in `rescue in initialize'
     # ./lib/acts_as_unvlogable/vg_youtube.rb:16:in `initialize'
     # ./lib/acts_as_unvlogable/vg_youtu.rb:9:in `initialize'
     # ./lib/acts_as_unvlogable.rb:103:in `new'
     # ./lib/acts_as_unvlogable.rb:103:in `service_object'
     # ./lib/acts_as_unvlogable.rb:86:in `load_service'
     # ./lib/acts_as_unvlogable.rb:26:in `initialize'
     # ./spec/acts_as_unvlogable_spec.rb:49:in `new'
     # ./spec/acts_as_unvlogable_spec.rb:49:in `block (3 levels) in <top (required)>'
     # ./spec/acts_as_unvlogable_spec.rb:348:in `check_video_attributes'
     # ./spec/acts_as_unvlogable_spec.rb:59:in `block (3 levels) in <top (required)>'

  5) UnvlogIt with an existent 'youtubed' metacafe url initialize a VgMetacafe instance
     Failure/Error: let(:videotron) { UnvlogIt.new("http://www.metacafe.com/watch/yt-r07zdVLOWBA/pop_rocks_and_coke_myth/", {:key => "AIzaSyCWdV1zQpyD1X1OdheU6UqfV3JR6JQXY9A" }) } # => Pop Rocks and Coke Myth
     ArgumentError:
       Unsuported url or service
     # ./lib/acts_as_unvlogable/vg_youtube.rb:20:in `rescue in initialize'
     # ./lib/acts_as_unvlogable/vg_youtube.rb:16:in `initialize'
     # ./lib/acts_as_unvlogable/vg_metacafe.rb:13:in `new'
     # ./lib/acts_as_unvlogable/vg_metacafe.rb:13:in `initialize'
     # ./lib/acts_as_unvlogable.rb:103:in `new'
     # ./lib/acts_as_unvlogable.rb:103:in `service_object'
     # ./lib/acts_as_unvlogable.rb:86:in `load_service'
     # ./lib/acts_as_unvlogable.rb:26:in `initialize'
     # ./spec/acts_as_unvlogable_spec.rb:84:in `new'
     # ./spec/acts_as_unvlogable_spec.rb:84:in `block (3 levels) in <top (required)>'
     # ./spec/acts_as_unvlogable_spec.rb:87:in `block (3 levels) in <top (required)>'

  6) UnvlogIt with an existent 'youtubed' metacafe url returns the video properties
     Failure/Error: let(:videotron) { UnvlogIt.new("http://www.metacafe.com/watch/yt-r07zdVLOWBA/pop_rocks_and_coke_myth/", {:key => "AIzaSyCWdV1zQpyD1X1OdheU6UqfV3JR6JQXY9A" }) } # => Pop Rocks and Coke Myth
     ArgumentError:
       Unsuported url or service
     # ./lib/acts_as_unvlogable/vg_youtube.rb:20:in `rescue in initialize'
     # ./lib/acts_as_unvlogable/vg_youtube.rb:16:in `initialize'
     # ./lib/acts_as_unvlogable/vg_metacafe.rb:13:in `new'
     # ./lib/acts_as_unvlogable/vg_metacafe.rb:13:in `initialize'
     # ./lib/acts_as_unvlogable.rb:103:in `new'
     # ./lib/acts_as_unvlogable.rb:103:in `service_object'
     # ./lib/acts_as_unvlogable.rb:86:in `load_service'
     # ./lib/acts_as_unvlogable.rb:26:in `initialize'
     # ./spec/acts_as_unvlogable_spec.rb:84:in `new'
     # ./spec/acts_as_unvlogable_spec.rb:84:in `block (3 levels) in <top (required)>'
     # ./spec/acts_as_unvlogable_spec.rb:348:in `check_video_attributes'
     # ./spec/acts_as_unvlogable_spec.rb:95:in `block (3 levels) in <top (required)>'

Finished in 43.19 seconds (files took 0.58128 seconds to load)
39 examples, 6 failures

Failed examples:

rspec ./spec/acts_as_unvlogable_spec.rb:24 # UnvlogIt with an existent youtube url initialize a VgYoutube instance
rspec ./spec/acts_as_unvlogable_spec.rb:31 # UnvlogIt with an existent youtube url returns the video properties
rspec ./spec/acts_as_unvlogable_spec.rb:51 # UnvlogIt with a shortened youtube URL initialize a VgYoutube instance
rspec ./spec/acts_as_unvlogable_spec.rb:58 # UnvlogIt with a shortened youtube URL returns the video properties
rspec ./spec/acts_as_unvlogable_spec.rb:86 # UnvlogIt with an existent 'youtubed' metacafe url initialize a VgMetacafe instance
rspec ./spec/acts_as_unvlogable_spec.rb:94 # UnvlogIt with an existent 'youtubed' metacafe url returns the video properties

Am I doing something wrongs?

pacuna commented 9 years ago

sorry, my key hadn't permissions for the youtube api. Thanks!