Giter Club home page Giter Club logo

video_info's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video_info's Issues

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

Not working for Vimeo videos.

Hi,
I am trying to get vimeo videos api but facing with following issue.

OpenURI::HTTPError: 403 Forbidden

Could you please help ASAP.
Thanks!

VideoInfo.get call is too slow; takes from 100ms to 500ms

Here are some sample results:

2.0.0p247 :001 > Benchmark.realtime{VideoInfo.get("http://www.youtube.com/watch?v=wby9pSVZ6hk")}
 => 0.554626 
2.0.0p247 :002 > Benchmark.realtime{VideoInfo.get("http://www.youtube.com/watch?v=GkBDRUO8hAo")}
 => 0.085865 
2.0.0p247 :003 > Benchmark.realtime{VideoInfo.get("http://www.youtube.com/watch?v=wby9pSVZ6hk")}
 => 0.109336 
2.0.0p247 :004 > Benchmark.realtime{VideoInfo.get("http://www.youtube.com/watch?v=wby9pSVZ6hk")}
 => 0.104984 
2.0.0p247 :005 > Benchmark.realtime{VideoInfo.get("http://www.youtube.com/watch?v=GkBDRUO8hAo")}
 => 0.125784 

I'm writing a simple blog that has many posts on the homepage and each post can have a video embed...this makes homepage loading dreadfully slow.

403

I am getting a 403 error when I call thumbnail_medium no matter what API key I use, including the api keys included in the documentation. I have tried both server and browser api keys and I have tried changing the user agent. Any ideas?

Custom providers

What is best way to register new provider?
It is hardcoded now:

def self.get_video(url, options)
    case url
    when /vimeo\.com/
      Vimeo.new(url, options)
    when /(youtube\.com)|(youtu\.be)/
      Youtube.new(url, options)
    end
  end

NameError: uninitialized constant VideoInfo::Provider::Net

video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
video.available?

NameError: uninitialized constant VideoInfo::Provider::Net
  from /Users/karl/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/video_info-2.1.0/lib/video_info/provider.rb:40:in `_response_code'
  from /Users/karl/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/video_info-2.1.0/lib/video_info/provider.rb:33:in `available?'
  from (irb):3
  from /Users/karl/.rbenv/versions/2.1.0/bin/irb:11:in `<main>'

add spec/fixtures to gitignore

Is there any reason spec/fixtures isn't in the gitignore? I've noticed that some are committed but I don't see why they're there.

It's kinda annoying to see this every git status :

weird regex issue?

With 'http://' .. all good.

VideoInfo.new('http://youtube.com/watch?v=Qi_AAqi0RZM') =>
#<VideoInfo:0x000001033db3d8 @video=#<Youtube:0x000001033daeb0
@openURI_options={"User-Agent"=>"VideoInfo/0.2.8"}, @provider="YouTube",
  @url="http://www.youtube.com/watch?v=Qi_AAqi0RZM", @title="Twilio's
definitive brogramming primer", @description="Rob \"Chad\" Spectre of Twilio
lays down the brogramming steez. Go to http://www.twilio.com to build some
chill apps, bro.", @keywords="brogramming, twilio brogram primer, rob spectre,
brogram, brogramming 101", @duration=875, @date=2011-09-22 21:09:43 UTC,
@thumbnail_small="http://i.ytimg.com/vi/Qi_AAqi0RZM/1.jpg",
@thumbnail_large="http://i.ytimg.com/vi/Qi_AAqi0RZM/0.jpg", @view_count=34589,
@video_id="Qi_AAqi0RZM">>

Without ... WHOAH.

VideoInfo.new('youtube.com/watch?v=Qi_AAqi0RZM') =>
#<VideoInfo:0x00000102f4c790 @video=#<Youtube:0x00000102f4c510
@openURI_options={"User-Agent"=>"VideoInfo/0.2.8"}, @provider="YouTube",
  @url="http://www.youtube.com/watch?v=", @title="Amy Winehouse - Our Day Will
Come: Amy Winehouse TributeIndia Talent Show - Warriors of Goja AMAZINGFAMILY
HOME DESTROYED BY AVALANCHE - CHILDREN TO BLAMEDavid Guetta (feat. Usher) -
Without You (cover) Megan NicoleAchmed the Dead Terrorist Has a Son - Jeff
Dunham - Controlled ChaosLos Vazquez Sounds ( rolling in the deep - Adele
around the world covers )Drake - The Motto ft. Lil WayneFuture - Tony Montana
(Behind The Scenes)8 Year Old Raps Mistletoe by Justin Bieber (MattyBRaps)Drake
- VEVO News InterviewHard And Black Realistic But Not Real GunKarmin - Get To
Know Karmin (VEVO LIFT)Little Mix are ready to Set It Off - The X Factor 2011
Live Show 7 - itv.com/xfactorMinecraft - \"Shadow of Israphel\" Outtakes
(Minecon Special!)Rihanna Performance - Top 10 Eliminations - THE X FACTOR USA
2011Minecraft - \"Shadow of Israphel\" Part 35: Lastwatch Hold (Minecon
Special!)asdasdags524_chunk_1.mp4First Memories of Music: Interview, Pt. 1
(VEVO LIFT)Adele - Set Fire To The RainFoster The People - Call It What You
WantMichael J. Fox Playing \"Johnny B. Goode\" LIVE!Real Madrid 6-2 Dinamo
Zagreb All Goals HD 22/11/2011MW3 THIS IS SPARTA! (Funny 300 Parody)Mieders
Alpine Coaster (with no brakes!!)Thug Le - Ladies vs Ricky Bahl",
@description="Lioness: Hidden Treasures out 5th Dec. Pre-order now: bit.ly
Music video by Amy Winehouse performing Our Day Will Come: Amy Winehouse
Tribute. (C) 2011 Lioness Records Ltd, under exclusive licence to
Universal-Island Records LtdI have no words for this.. just AMAZING Visit My
blog for more amazing videos 66evol.blogspot.comMommy was not feeling well and
had to stay in the bathroom longer than usual during which my two boys, ages 1
and 3 took my new bag of flour out of the cupboard and destroyed my house. This
is from ONE 5lb bag. Don't believe me? Hand a full bag to a 3 year old and see
what happens.Download my original \"Bea-utiful\" on itunes: itunes.apple.com
\"Without You\" (cover) Itunes: itunes.apple.com **Thank you for over 600000
subscribers! Wow...thank you, thank you, thank you...I greatly appreciate all
of your support! Much love Love this song...Hope you enjoy :) Special thanks to
Brian Reeves! You can find me on... FACEBOOK: www.facebook.com TWITTER:
www.twitter.com WEBSITE: www.megannicolemusic.com Got an instagram? Follow me
@megannicolemusic 'Without You' - originally by David Guetta ft. Usher Written
by Pierre Guetta, Usher Raymond, Giorgio Tuinfort, Frédéric Riesterer, Rico
Love, Taio Cruz Published by: EMI Music Publishing, Sony ATV Music Publishing &
Shapiro Bernstein & Co Inc :)descarga la cancion / download : hulkshare.com
around the world covers of rolling in the deep vazquez sounds cover rolling in
the deep vazquezsoundsDrake - The Motto ft. Lil Wayne Drake - The Motto Drake -
The Motto Drake - The Motto Drake - The Motto Drake - The MottoMusic video by
Future performing Tony Montana - Behind The Scenes. (C) 2011 Sony Music
EntertainmentOfficial Giveaway Rules Below! Hi B Boys and B Girls! Thanks for
watching my version of \"Mistletoe\" by Justin Bieber. The Holiday Season is
officially here and after all of the support you have given me this past year,
I really want to give something nice back to you! I'm giving away one free pair
of BeatsByDre TOUR In Ear Headphones to one random B Boy or B Girl who
participates in the MattyBRaps 2011 Christmas Giveaway! If you want to know
more about these headphones, click here: beatsbydre.com Official MattyBRaps
2011 Christmas Giveaway Rules: 1. Subscribe to YouTube.com/MattyBRaps 2. Submit
your e-mail to MattyBRaps.Fanbridge.com 3. Leave a comment about what you want
for Christmas! Winner will be randomly chosen on December 24th, 2011. This
Giveaway is available to ALL B Boys and B Girls WORLDWIDE so be sure to
participate! This contest is in compliance with YouTube's Terms of Service and
Community Guidelines which can be found here TOS: www.youtube.com CG:
www.youtube.com Merry Christmas and Happy Holidays from my family to yours! :)
OFFICIAL MATTYB LINKS: Main Channel www.MattyBRaps.com Vlog Channel http
Twitter www.Twitter.com Facebook www.Facebook.com DailyBooth (Pics)
www.DailyBooth.com To purchase the instrumental track used to record this song,
click here! itunes.apple.comVEVO News sits down with Drake to talk TAKE CARE,
in stores now: vevo.ly © 2011 Cash Money Records/Young Money Ent./Universal
Rec.No guns were hurt in the making of this crap. www.youtube.com
www.twitter.com www.facebook.com www.higatv.comGet to know our newest LIFT
artist, Karmin! They are here to #CrashYourParty! See more at: www.vevo.com ©
2011 EpicThe X Factor: Little Mix \"work their bottoms off\" says Perrie and
this week, as part of their hectic schedule, they got to meet The Saturdays to
get advice about being a successful girl group. They also got to go to the
Twilight premiere and Eek and Oh Em Gee indeed, they only got a message from
Taylor Lautner. See him speak right here! See more at itv.com Buy this
performance from iTunes: bit.lyThe brand new Minecraft episode showing a
variety of outtakes, as shown excusively at Minecon 2011! Thanks to everyone
who came and saw us in person at our panel! We'll put the rest of the panel up
over the next few days! ● Yogscast Gear: yogscast.spreadshirt.co.uk ♪ Daniel
Yount: itunes.apple.com ♦ Intro splashscreen by explosivewhale ♦ Additional
artwork by Lalna ● Facebook: www.facebook.com ● Twitter: www.twitter.com ●
Forums: yogscast.com ● Podcast: itunes.apple.comRihanna performs \"We Found
Love.\" Pre-Order Rihanna's new album Talk That Talk: smarturl.it Available
everywhere 11.21.11! bit.ly (Official Site) bit.ly ('Like' on Facebook) bit.ly
(Follow on Twitter)The brand new Minecraft episode, as shown excusively at
Minecon 2011! Thanks to everyone who came and saw us in person at our panel!
We'll put the rest of the panel up over the next few days! ● Yogscast Gear:
yogscast.spreadshirt.co.uk ♪ Daniel Yount: itunes.apple.com ♦ Intro
splashscreen by explosivewhale ♦ Additional artwork by Lalna ● Facebook:
www.facebook.com ● Twitter: www.twitter.com ● Forums: yogscast.com ● Podcast:
itunes.apple.comasdasdags524_chunk_1.mp4We hang out with Amy & Nick of
@KarminMusic, play some skee-ball and talk music! See more at: www.vevo.com
#CrashYourParty © 2011 EpicMusic video by Adele performing Set Fire To The
Rain. (C) 2011 XL Recordings LtdMusic video by Foster The People performing
Call It What You Want. (c) 2011 Sony Music EntertainmentBy AnnaGoldfarb.com
Here's Michael J. Fox rocking out at the Waldorf-Astoria. www.michaeljfox.org
Read the full story behind the video here:
www.shmittenkitten.comwww.facebook.com Real Madrid 6-2 Dinamo Zagreb All Goals
HD 22/11/2011 real madrid vs dinamo zagreb 6-2 full highlights all goals
Benzema Ozil Callejón Higuain; Beqiraj TomecakSubmit yo clips/refer people here
- the2bucks.com MW3 The Opposite of Taking One for the Team: www.youtube.com
MW3 THIS IS SPARTA! (Funny 300 Parody) Clip By: www.youtube.com With help by:
www.youtube.com Music used: www.youtube.com Personal channel for my personal
fans: www.youtube.com My Twitter: twitter.com My Facebook: facebook.com
Controller Affiliate: www.modz-armory.com IF YOU COME ACROSS A FUNNY/AMAZING
COD CLIP ON YOUTUBE, COMMENT ON IT TELLING THE PERSON TO SUBMIT IT TO
AMAZINGFILMS247! AmazingFilms247 \"MW3 Funny\" mw3 funny \"modern warfare 3
funny\" \"MW3 Funny\" mw3 funny \"modern warfare 3 funny\" \"MW3 Funny\" mw3
funny \"modern warfare 3 funny\"This is a single-pipe alpine coaster in
Mieders, Austria. You reach the summit via a cablecar and then sit on a small
car with a brake lever and off you go. Having ridden it once using a little
braking, I decided to try it a second time without using the brakes. This is
SCARY! Enjoy the ride! Off-ride footage here www.youtube.comRelease Date: 09
December 2011 Genre: Romance Starring: Ranveer Singh, Anushka Sharma, Dipannita
Sharma, Aditi Sharma and Parineeti Chopra Producer: Aditya Chopra Director:
Maneesh Sharma Music: Salim - Sulaiman Lyrics: Amitabh Bhattacharya After the
heartwarming success of BAND BAAJA BAARAAT, director Maneesh Sharma is back
with his team, in YASH RAJ FILMS' next offering LADIES vs RICKY BAHL. Starring
Ranveer Singh, who has won everyone's heart with his endearing and
scintillating performance, as well as the Best Actor (Debut) at all the award
shows this year, and the accomplished and charismatic Anushka Sharma, the film
is produced by Aditya Chopra and is based on a story developed by him. Habib
Faisal has written the dialogues, the screenplay is by Devika Bhagat. The music
is composed by Salim-Sulaiman, lyrics by Amitabh Bhattacharya and the film is
shot by Aseem Mishra (DOP), all of whom have been a part of BAND BAAJA BAARAAT.
LADIES vs RICKY BAHL is a fun-filled \"ROM-CON\" where a smooth and charming
conman, Ricky Bahl, cons girls for a living but finally meets his match. The
film will be in theatres worldwide on 9th Dec 2011, the same weekend BAND BAAJA
BAARAAT released.", @keywords="Amy, Winehouse, Our, Day, Will, Come:, Tribute,
Island, Records, Pop, Hidden, 2011, Between, The, Cheats, Tears, Dry, Wake, Up,
Alone, Girl, From, Ipanema, Halftime, Best, Friends, Body, Soul, Tony, Bennett,
Song, For, You, VEVOIndia, Talent, Show, Warriors, of, Goja, AMAZING, Got,
Factor, Talent Show, Got Talent, jassi, sidhu, 66, evoChild, Family, Infant,
Friends, Fun, Parents, School, Live, children, flour, homeschooling, babies,
kids, kid, house, food, everywhere, overwhelmed, overwhelming, mom, dad,
brothers, brother, snow, first, paint, hair, destroy, trouble, two, three, one,
little, small, large, big, Childrens, Preschool, mtmuzicWithout, You, David,
Guetta, feat., featuring, Usher, Megan, Nicole, cover, Megannicolesite, lyrics,
official, music, video, amasJeff, Dunham, Controlled, Chaos, Achmed, Walter,
Peanut, Little, Junior, Bubba, Spark, Insanity, Christmas, Special, Arguing,
With, Myself, Father, Son, Beer, Santa, Merry, Bombs, Jingle, Wound, Touching,
Flesh, Scary, Scares, Silence, Kill, Keel, marnell, oma, duct, tape, dad, Very,
Funny, Nice, Double, Comedy, DVD, TV, kid, child, omg, skeleton, bones,
ventriloquist, ventriloquism, stand-up, stand, up, thanksgiving, family,
laughing, incredible, jeffdunhamvazquezsounds, los, vazquez, sounds, rolling,
in, the, deep, around, world, cover, adele, Adele (singer), Rolling In The
Deep, losvazquezsoundsDrake The Motto, Drizzy, Drake, OfficiaFuture, Tony,
Montana, Behind, The, Scenes, Epic, Hip, Hop, VEVOMistletoe, Justin, Bieber,
mattybraps, mattyb, Christmas, Giveaway, Under the Mistletoe, Mariah, Carey,
All I Want For Christmas, Drummer, Boy, Busta, Rymes, Music, Music Video, free,
contest, cute, adorable, year, old, rapper, rapping, rap, hiphop, boys, girls,
kids, family, children, christmas music, xmas, holiday, holidays, season,
holiday season, gifts, gift, christmas present, christmas presents, presents,
teen, interest, young, pop, culture, red, green, tween, remix, Merry Christmas,
Santa, Clause, Jesus, Christ, Matty, brapsdrake, drizzy, lil, wayne, weezy,
stevie, wonder, old, school, new, take, care, headlines, nicki, minaj, rihanna,
VEVOhard, and, black, realistic, but, not, real, gun, nigahiga, ryan, higa,
guns, infomercial, commercialCrash, Your, Party, Karmin, music, arcade, VEVO,
LIFT, AMA, amas, new, media, Amy, Nick, covers, youtubeThe, Factor, 2011,
Bootcamp, xfactor, thexfactor, thexfactoruk, Gary, Barlow, Louis, Walsh, Kelly,
Rowland, Tulisa, Contostavlos, Simon, Cowell, Cheryl, Cole, Dannii, Minogue,
Auditions, funny, singing, competition, tv, talent, reality, uk, england,
britain, keys, boys, hot, gorgeous, sexy, men, muscles, five, boyband, boy,
band, singers, harmony, harmonies, rap, rapping, take, that, going, home,
through, judges, houses, live, show, nerves, movie, movies, night, little, mix,
en, vogue, set, it, offshadow of israphel, yogscast, xephos, honeydew, simon,
lewis, minecraft, stoneholm, deepcore, skyhold, knight peculier, BlueWe Found
Love, Rihanna, Performance, Top 10 Eliminations, xfactor, simon, cowell, tv,
the X tor, factor, simon cowell, television, ad, fall, 2011, music, reality,
competition, usa, song, twitter, auditions, audition, paula, abdul, nicole,
scherzinger, antonio, la, reid, steve, jones, United States, Theshadow of
israphel, yogscast, xephos, honeydew, simon, lewis, minecraft, stoneholm,
deepcore, skyhold, knight peculier, Blueasdasdags524_chunk_1.mp4, heakzlksio,
23Crash, Your, Party, Karmin, music, arcade, VEVO, LIFT, AMA, amas, new, media,
Amy, Nick, covers, youtubeAdele, Set, Fire, To, The, Rain, XL,
Recordings/Columbia, Pop, VEVOFoster, The, People, Call, It, What, You, Want,
Columbia, Alternative, fosterthepeople, VEVOmichael j. fox, Johnny B. Goode,
Miss, Shmitten, KittenReal, Madrid, 6-2, Dinamo, Zagreb, All, Goals, HD,
22/11/2011, vs, full, highlights, Benzema, Ozil, Callejón, Higuain, Beqiraj,
Tomecak, Real Madrid CF, Karim Benzema, clhighlights, 2012mw3, modern warfare
3, modern, warfare, mw3 funny, funny, modern warfare 3 funny, mw3 sniping, mw3
parody, this, is, sparta, 300, modern warfare 3 sniping, sniping, sniper, epic,
mw3 killcam, call, of, duty, moab, mw3 moab, modern warfare 3 moab, mw3 quad,
quad, feed, cod mw3, mw3 gameplay, gauntlet, mw3 the gauntlet, amazingfilms247,
new, cod, amazing, 2bucks, Films, 247Alpine, Coaster, Sommer, Rodelbahn,
Austria, Roller, Brakes, Alps, white, knuckle, OMG, Ski, pipe, sommerrodelbahn,
ECC, achterbahn, davidjellisRanveer, Singh, Anushka, Sharma, Maneesh, Salim,
Sulaiman, Amitabh, Bhattacharya, Aditya, Yash, Chopra, Bollywood, India, Hindi,
Film, Movie, Indian, Cinema, Studio, Shooting, Acting, Song, Music, Lyrics,
Singing, Dance, Action, Funny, Comedy, Fight, Romance, Love, Emotion, Drama,
Thrill, Passion, Romantic, Hot, Sexy, Couple, Actor, Actress, Hero, Heroine,
Boy, Girl, Promo, Trailer, Hollywood, yrf", @duration=192, @date=2011-11-18
10:18:18 +0000, @thumbnail_small="http://i.ytimg.com/vi/CxYRbzGi8Rg/1.jpg",
  @thumbnail_large="http://i.ytimg.com/vi/CxYRbzGi8Rg/0.jpg",
  @view_count=1081026>> 

VimeoPro support

Hey ho.

I just came across VimeoPro. It'S Vimeo with customized pages, but it still allows for embeding the videos. Would be could when it would work, right?

An URL of VimeoPro looks something like: http://vimeopro.com/talentrelations/studentwork/video/52377271

Would that be something, that is easily achieved?

YouTube embed code

I noticed that YouTube suggests following embed code:

<iframe width="640" height="480" src="//www.youtube-nocookie.com/embed/uNBjBL1qXaQ" frameborder="0" allowfullscreen></iframe>

while video_info #embed_code outputs:

<iframe src="http://www.youtube.com/embed/uNBjBL1qXaQ" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

Notice embed url difference.

Not available with valid url

Hi,

I'm trying to use video_info in rails project.
But available? returns false with present youtube url like "http://www.youtube.com/watch?v=mZqGqE0D0n4"

I used like this
config/initializers/video_info.rb

VideoInfo.provider_api_keys = { youtube: ' *** valid api key *** ' }
VideoInfo.disable_providers = %w[dailymotion wistia]

model/video.rm

validate do
    begin
      video = VideoInfo.new(video_url)
      if video_url.present? && ! video.available?
        p video
        p video.available?
        errors.add(:video_url, "seems to be invalid")
      end
    rescue VideoInfo::UrlError
      errors.add(:video_url, "is invalid")
    end
end

Outputs are below.

"http://www.youtube.com/watch?v=mZqNqE0p0n4"
#<VideoInfo:0x007f7ff2c7ea88 @provider=#<VideoInfo::Providers::Youtube:0x007f7ff2c7e308 @options={"User-Agent"=>"VideoInfo/2.4.2"}, @url="http://www.youtube.com/watch?v=mZqNqE0p0n4", @video_id="mZqNqE0p0n4">>
false

Looking forward to hearing from you soon.
Thank you!

Getting a NameError (uninitialized constant error

The code below works fine in development mode using ruby 2.2.0

However on my production server using ruby 2.1.2 I get the following error:

I, [2015-08-02T01:11:12.742798 #5361] INFO -- : Completed 500 Internal Server Error in 52ms (ActiveRecord: 8.8ms)
F, [2015-08-02T01:11:12.743799 #5361] FATAL -- :
NameError (uninitialized constant Admin::ChampionPhotosController::VideoInfo):
app/controllers/admin/champion_photos_controller.rb:35:in block in create' app/controllers/admin/champion_photos_controller.rb:31:increate’

Here’s my code to add the large vimeo thumbnail to the db and upload via carrier wave.

unless @admin_champion_photo.video.blank?
     video_image = VideoInfo.new("#{@admin_champion_photo.video}")
     thumbnail = Admin::ChampionPhoto.find(@admin_champion_photo.id)
     thumbnail.remote_photo_url = video_image.thumbnail_large
     thumbnail.save
   end

Could it be a ruby version issue or something else I'm missing on the production side?

I added it to the server as gem install video_info

Then as an added measure also to the gem file as gem 'video_info' and ran bundle install.

New Travis-CI infrastructure causes 429 (Too many requests) HTTP error

I tried to update to the new Travis-CI infrastructure, but it causes the Youtube scraper to give 429 HTTP errors. I imagine Youtube, for whatever reason, just blocked that IP.

This isn't an issue on the legacy infrastructure, but we should let Travis know and see if they have a solution, since the legacy infrastructure will surely be removed eventually.

If they can't fix it, we could try using a proxy I guess. We could also download the Youtube pages manually and use them in mocks, but that means we wouldn't know if Youtube makes any HTML changes that break things.

undefined method `provider_api_keys=' for VideoInfo:Class

Hello,

Thanks for your useful gem.

I had a error when put 'VideoInfo.provider_api_keys = { youtube: 'YOUR_API_KEY' }' in new action in my controller. 'VideoInfo.new' is working properly.

I tried to update gem but is not resolved.

Where should I put youtube provider api keys?

on error (not valid id) return nil object

Its would be better if it would return a nilobject, but now its return a youtube object with openURI_options, iframe_attributes and nothing else.
What is your opinion?

Add Vimeo scraper

PR #87 updates the Vimeo API from v2 to v3, which requires an API key.

We should implement a scraper to be used when no Vimeo API key is provided, like we do with Youtube.

Unable to pull YouTube Title, Description, Duration, and Date

Ever since the API change by YouTube I haven't been able to get the title, description, or date of any videos. The duration is also not working as it always returns a value of 0. The available also appears broken as it always returns false (as noted in other issues). The video_id, provider, thumbnails, etc. have all been working just fine. I was excited for the latest release (2.5.0), but it didn't seem to fix the issue.

Uninitialized constant error in production

I am getting the same uninitialized constant error on my production server that has ruby 2.2.2 and Rails 4.2.3. Exact same settings on my development laptop work just fine, but not so on the server.

Production server OS is Debian Wheezy. Here's the error in the production log file:

NameError (uninitialized constant Admin::ReelsController::VideoInfo):
app/controllers/admin/reels_controller.rb:58:in block in update' app/controllers/admin/reels_controller.rb:54:inupdate'

And here's the code in my create method:

unless @admin_reel.reel.blank? && @admin_reel.photo == ''
video = VideoInfo.provider_api_keys = { vimeo: 'my_key_info_removed_here' }
video = VideoInfo.new("#{@admin_reel.reel}")
video_image = Admin::Reel.find(@admin_reel.id)
video_image.remote_photo_url = video.thumbnail_large
video_image.save
end

In my gemfile:

gem 'video_info', :git => 'https://github.com/thibaudgg/video_info.git'

I also did a system install:

gem install video_info

400 Bad Request error suppressed when invalid API key is provided

VideoInfo::Providers::Youtube.available? suppresses errors via rescue false.

VideoInfo.provider_api_keys = { youtube: 'INVALID_KEY'}
video = VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4')
puts video.available? #false
#(400 Bad Request error suppressed)
VideoInfo.provider_api_keys = {}
video = VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4')
puts video.available? #false
#(400 Bad Request error suppressed)
VideoInfo.provider_api_keys = { youtube: 'VALID_KEY'}
video = VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4')
puts video.available? #true

yt:statistics not returned when there's no Views on a Video

Hi there,

In youtube.rb, this line wrongly assumes that there will always be a yt:statistics field returned by Youtube:
@view_count = doc.search("yt:statistics").first[:viewcount].to_i

Here is the error i got:
app/models/video.rb:55:in new' app/models/video.rb:55:in_unmemoized_video_infos'
app/models/video.rb:7:in valid_video?' app/views/videos/index.html.haml:7:in_app_views_videos_index_html_haml__1691334141_2165865320_0'
app/views/videos/index.html.haml:4:in _app_views_videos_index_html_haml__1691334141_2165865320_0' app/views/videos/index.html.haml:3:ineach'

Here is the XML i got : https://gist.github.com/761269

...But it's no longer a problem as soon as the video gets some Views. So it's not a major issue, but it took me some time to figure that out, so i thought i would let you know about it.

Best regards (and Happy New Year!),

Julien

SSL issues with Jruby (only on Travis-CI)

20 Vkontakte specs fail with jruby and nowhere else.

They all seem to have the same error, which seems to be related to SSL:

Java::JavaLang::RuntimeException:
  Could not generate DH keypair

UPDATE: read thread for new details.

Vkontakte#available? returns true with private video

The issue is that it is giving a 200 response code.

  1) VideoInfo::Providers::Vkontakte#available? with private video available? should be falsey
     Failure/Error: its(:available?)       { should be_falsey }
       expected: falsey value
            got: true
     # ./spec/lib/video_info/providers/vkontakte_spec.rb:60:in `block (4 levels) in <top (required)>'

Embed code not working

Hi,

Thanks for the good work ! I have an issue with the embed_code that do not include the http or https prefix. When copy/pasting the embed_code into a blank html page, the video is not showing and I got a "missing file" error.

Tried with https://www.youtube.com/watch?v=juRUOGv1T2k and html code is:

<html>
<head>
  <title>asda</title>
</head>
<body>

  <iframe src="//www.youtube.com/embed/juRUOGv1T2k" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

</body>
</html>

If I manually add http it's working under Chrome 34

Thanks !

different behavior of providers

VideoInfo.get '<a href="videolink">videolink</a>'

returns info for vimeo links, but not youtube links.

Reverting #10 can make it to return youtube info.

16:9 aspect videos

It appears that the youtube medium thumbnail is 4:3 and the vimeo medium thumbnail is 16:9. It would be really good if there were a way of asking for a medium 16:9 image. This probably applies to other formats as well.

Not available with valid Youtube URL

Hi,

I'm trying to use video_info in rails project.
But available? returns false with present youtube url like "http://www.youtube.com/watch?v=mZqGqE0D0n4"

I used like this
config/initializers/video_info.rb

VideoInfo.provider_api_keys = { youtube: ' *** valid api key *** ' }
VideoInfo.disable_providers = %w[dailymotion wistia]

model/video.rm

validate do
    begin
      p video_url
      video = VideoInfo.new(video_url)
      if video_url.present? && ! video.available?
        p video
        p video.available?
        errors.add(:video_url, "seems to be invalid")
      end
    rescue VideoInfo::UrlError
      errors.add(:video_url, "is invalid")
    end
end

Outputs are below.

"http://www.youtube.com/watch?v=mZqNqE0p0n4"
#<VideoInfo:0x007f7ff2c7ea88 @provider=#<VideoInfo::Providers::Youtube:0x007f7ff2c7e308 @options={"User-Agent"=>"VideoInfo/2.4.2"}, @url="http://www.youtube.com/watch?v=mZqNqE0p0n4", @video_id="mZqNqE0p0n4">>
false

Looking forward to hearing from you soon.
Thank you!

Gem is broken? uninitialized constant VideoInfo::VERSION

When I install the gem in my gemfile, then run the simple examples I get the following error...

uninitialized constant VideoInfo::VERSION
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/video_info-1.1.0/lib/video_info.rb:30:in clean_options' c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/video_info-1.1.0/lib/video_info.rb:9:inget'

My code is as follows... in the gemfile ...
gem 'video_info'

In a controller...
video = VideoInfo.get('http://www.youtube.com/watch?v=mZqGqE0D0n4')

I am using Rails 3 w/ Windows 7.

undefined method `url' for #<Object:0x007f807a8cd780>

In version 2.30 I'm getting this error with url method.

2.0.0 (main):0 > v = VideoInfo.new 'http://www.youtube.com/watch?v=L7U6STcaCkU' (pry) output error: #<NoMethodError: undefined method url' for #Object:0x007f807a8cd780>`

undefined method `provider_api_keys' for VideoInfo:Class (NoMethodError)

I created a brand new project.

Gemfile has gem 'video_info', github: 'thibaudgg/video_info'

But when I do:

require 'video_info'

VideoInfo.provider_api_keys = { youtube: 'MY_KEY' }

It throws the
undefined method 'provider_api_keys' for VideoInfo:Class (NoMethodError)

I'm positive I'm using the master verison as my Gemfile.lock says:

GIT
  remote: git://github.com/thibaudgg/video_info.git
  revision: 002bcc4161c6d296c1fe59b201de00fb9071b4ed
  branch: master
  specs:
    video_info (2.4.2)
      addressable
      htmlentities
      iso8601
      multi_json (~> 1.11)
      oga
      open_uri_redirections

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.