mamuso / acts_as_unvlogable Goto Github PK
View Code? Open in Web Editor NEWAn easy way to include external video services in a rails app.
License: MIT License
An easy way to include external video services in a rails app.
License: MIT License
Just a small heads up: the youtube_it gem is not working anymore.
Youtube finally switched off the V2 of their Data API on May 6th 2015 (source). The gem's author seems to be unresponsive to the new situation (kylejginavan/youtube_it#251) so, right now, this gem seems to be a dead end.
As mentioned in the previous link, some people is migrating to http://github.com/Fullscreen/yt. They support v3 and have a migration document: https://github.com/Fullscreen/yt/blob/master/YOUTUBE_IT.md. Unfortunately this gem requires ruby '>= 1.9.3' so if you switch to it, this new interpreter requirement should be stated in the acts_as_unvlogable gemspec.
The "vg_vimeo.rb" file needs to be updated. I have a working copy but cant paste it into here. The API has changed.
Collegehumor.com is now changed url pattern that is not supported by unvlogit now. Can you let me know what is the problem regarding it.
URL pattern supported by it:
www.collegehumor.com/video:1781900
But latest url pattern:
http://www.collegehumor.com/video/3004669/see-something-say-something
and flickr.com's videos are also not supported by it.
It only supports dailymotion.com and youtube.com
Hi mamuso,
I tried to parse random Rutube url from the main page http://rutube.ru/video/536e5c9548348e7ee9cdfcc5e1f149ea/ and got an error. Does Rutube respond with invalid XML?
Loading development environment (Rails 3.2.8)
1.9.3p194 :001 > aha = UnvlogIt.new 'http://rutube.ru/video/536e5c9548348e7ee9cdfcc5e1f149ea/'
=> #<UnvlogIt:0xbb8d4e4 @object=#<VgRutube:0xbb8ce68 @url="http://rutube.ru/video/536e5c9548348e7ee9cdfcc5e1f149ea/", @movie_id="536">>
1.9.3p194 :002 > aha.title
REXML::ParseException: #<REXML::ParseException: Missing end tag for 'hr' (got "body")
Line: 6
Position: 175
Last 80 unconsumed characters:
>
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:335:in `pull_event'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:183:in `pull'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:22:in `parse'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/document.rb:231:in `build'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:965:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:965:in `parse'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:164:in `xml_in'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:203:in `xml_in'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable/vg_rutube.rb:69:in `rt_info'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable/vg_rutube.rb:9:in `title'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable.rb:33:in `title'
(irb):2:in `irb_binding'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/workspace.rb:80:in `eval'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/context.rb:254:in `evaluate'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:70:in `block in start'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:69:in `catch'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb.rb:69:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
...
Missing end tag for 'hr' (got "body")
Line: 6
Position: 175
Last 80 unconsumed characters:
Line: 6
Position: 175
Last 80 unconsumed characters:
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:95:in `rescue in parse'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:20:in `parse'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/document.rb:231:in `build'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:965:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:965:in `parse'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:164:in `xml_in'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/xml-simple-1.1.2/lib/xmlsimple.rb:203:in `xml_in'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable/vg_rutube.rb:69:in `rt_info'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable/vg_rutube.rb:9:in `title'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable.rb:33:in `title'
from (irb):2
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'1.9.3p194 :003 > aha.embed_url
=> nil
UnvlogIt.new("http://www.ted.com/talks/amory_lovins_a_50_year_plan_for_energy.html")
responds with an unsupported video type! Would love if you could patch this up! Thanks for the gem
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?
Hello
i have to used that for vimeo but when i am fetching imformation form vimo it is giving me error
videotron = UnvlogIt.new("http://vimeo.com/79794849")
ArgumentError: Unsuported url or service
from /home/cis/.rvm/gems/ruby-1.9.3-p374@linkmission/gems/acts_as_unvlogable-1.0.0/lib/acts_as_unvlogable.rb:26:in initialize' from (irb):15:in
new'
from (irb):15
from /home/cis/.rvm/gems/ruby-1.9.3-p374@linkmission/gems/railties-3.1.12/lib/rails/commands/console.rb:45:in start' from /home/cis/.rvm/gems/ruby-1.9.3-p374@linkmission/gems/railties-3.1.12/lib/rails/commands/console.rb:8:in
start'
from /home/cis/.rvm/gems/ruby-1.9.3-p374@linkmission/gems/railties-3.1.12/lib/rails/commands.rb:40:in <top (required)>' from script/rails:6:in
require'
from script/rails:6:in `
Here is an url example http://vk.com/video105897545_164788301
Hello,
when I am trying to install acts_as_unvlogable gem I got the below error
invalid gem: package metadata is missing in /home/cis/.rvm/gems/ruby-2.1.1@linkmission_test/cache/youtube_it-2.1.1.gem
I am using ruby 2.1.1 version
and rails 4.1
There's a problem with Dailymotion thumbnails that i can't understand and obviously, don't know how to solve.
The thing is that Dailymotion's API returns invalid or malformed URL's for it's thumbnails.
This is an example for the same video.
Valid thumb URL grabbed from their own site: http://ak2.static.dailymotion.com/static/video/638/506/4605836:jpeg_preview_medium.jpg?20090109074910
Invalid thumb URL fetched through their API:
http://ak2.static.dailymotion.com/dyn/preview/160x120/4605836:jpeg_preview_large.jpg
I guess it's due to some kind of protection against mass thumbs grabbing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.