Giter Club home page Giter Club logo

Comments (14)

vheuken avatar vheuken commented on June 30, 2024

That's odd. Are you using the scraper or the API?

Are you sure you're using 2.5.0? Try this and see if it helps:

gem uninstall video_info
bundle clean
bundle install

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

I uninstalled all versions of video_info, cleaned, and reinstalled. It doesn't seem to have changed anything. I am pretty sure I am using the API. My code is as follows:

VideoInfo.provider_api_keys = { youtube: '<MYKEY>' }
begin
  video = VideoInfo.new(url)
rescue
  errors.add(:url, "URL link is not valid")
  return
end
puts(video.available?)
if !video.available?
  begin
    self.title = video.title.to_s

    puts("Video ID: " + video.video_id.to_s)
    puts("Provider: " + video.provider.to_s)
    puts("Title: " + video.title.to_s) # Not working
    puts("Description: " + video.description.to_s) # Not working
    puts("Duration: " + video.duration.to_s) # Not working
    puts("Date: " + video.date.to_s) # Not working
    puts("Small thumbnail: " + video.thumbnail_small.to_s)
    puts("Medium thumbnail: " + video.thumbnail_medium.to_s)
    puts("Large thumbnail: " + video.thumbnail_large.to_s)
    puts(video.embed_url)
    puts(video.embed_code)
    puts(video.embed_url)

    self.image_url = video.thumbnail_small
  rescue
    errors.add(:url, "Error loading URL data")
    return
  end
else
    errors.add(:url, "Video link is not valid")
end

from video_info.

vheuken avatar vheuken commented on June 30, 2024

Can you try it with the scraper? To use the scraper, just delete the first line VideoInfo.provider_api_keys = { youtube: '<MYKEY>' }

I just tried it with the scraper and it worked fine:

2.2.2 :003 > a = VideoInfo.new('https://www.youtube.com/watch?v=BwSoPjRhJpc')
 => #<VideoInfo:0x00000001a67308 @provider=#<VideoInfo::Providers::Youtube:0x00000001a66a70 @options={"User-Agent"=>"VideoInfo/2.5.0"}, @url="https://www.youtube.com/watch?v=BwSoPjRhJpc", @video_id="BwSoPjRhJpc">> 
2.2.2 :004 > a.duration
 => 1835 
2.2.2 :005 > a = VideoInfo.new('https://www.youtube.com/watch?v=cxk-cs6n_K0')
 => #<VideoInfo:0x000000008d37e0 @provider=#<VideoInfo::Providers::Youtube:0x000000008d1850 @options={"User-Agent"=>"VideoInfo/2.5.0"}, @url="https://www.youtube.com/watch?v=cxk-cs6n_K0", @video_id="cxk-cs6n_K0">> 
2.2.2 :006 > a.duration
 => 11 
2.2.2 :007 > a.date
 => 2013-11-30 00:00:00 -0800 
2.2.2 :008 > a.title
 => "shoegaze.mov" 
2.2.2 :009 > a.description
 => "[vacuuming intensifies]" 

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

Deleting the first line gives me the following error:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Is this related?

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

The SSL error only happens when I try to pull available, date, duration, title, and description (same as API).

from video_info.

vheuken avatar vheuken commented on June 30, 2024

Huh, this is very odd.

Could you try cloning this repository, running rspec, and seeing if the tests pass?

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

Assuming I did this right I got 366 examples, 96 failures, 1 pending. What information would be beneficial?

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

It looks like this error is consistent:
OpenSSL::SSL::SSLError:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

from video_info.

vheuken avatar vheuken commented on June 30, 2024

Assuming I did this right I got 366 examples, 96 failures, 1 pending. What information would be beneficial?

The tests all pass on my machine, Travis-CI, and other people's machines, so the issue seems to be unique to your PC. So I don't think I'll be able to reproduce it.

It looks like your issue has been discussed here: http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat

Have you looked into any of the solutions posted there?

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

I tried a few simple solutions. I'll give it some more solid effort later today.

from video_info.

gbean467 avatar gbean467 commented on June 30, 2024

I've tried updating openssl on my computer, adding certs, removing and reinstalling gems, and so on, but nothing seems to work. In the end I think it could likely be because I am coding on a Windows machine.

http://stackoverflow.com/questions/8567973/why-does-accessing-a-ssl-site-with-mechanize-on-windows-fail-but-on-mac-work

But after making all these changes on my local machine I re-deployed and looks the like gem is working exactly as expected on my live site!

from video_info.

vheuken avatar vheuken commented on June 30, 2024

Cool. Sorry it won't work on your Windows machine. Since the issue appears to be outside the scope of video_info, I'm closing this issue.

from video_info.

YXsagittarius avatar YXsagittarius commented on June 30, 2024

With the same problem, and I'm using mac, could you help me?

from video_info.

vheuken avatar vheuken commented on June 30, 2024

@YXsagittarius StackOverflow would probably be a better place to ask.

from video_info.

Related Issues (20)

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.