Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No info is returned #163

Closed
howells opened this issue Oct 26, 2016 · 5 comments
Closed

No info is returned #163

howells opened this issue Oct 26, 2016 · 5 comments

Comments

@howells
Copy link

howells commented Oct 26, 2016

I can't seem to get this gem to work as expected. Even with API keys specified for YouTube and Vimeo, I can't return any info at all.

VideoInfo.new("https://vimeo.com/177713990")

simply returns

#<VideoInfo:0x007fdf416feeb0 @provider=#<VideoInfo::Providers::Vimeo:0x007fdf416fe7f8 @options={"User-Agent"=>"VideoInfo/2.6.1"}, @url="https://vimeo.com/177713990", @video_id="177713990">>

The same applies for all providers, and all videos. Any ideas where I'm going wrong?

@thibaudgg
Copy link
Owner

Seems normal, all data are eager loaded when you first requests them.
What happens if you try VideoInfo.new("https://vimeo.com/177713990").title ?

@howells
Copy link
Author

howells commented Oct 26, 2016

Oh, apologies - I didn't realise that, assumed it would return everything - works perfectly ;-)

@howells howells closed this as completed Oct 26, 2016
@howells howells reopened this Oct 26, 2016
@howells
Copy link
Author

howells commented Oct 26, 2016

Sorry - closed to soon. Almost me misunderstanding something, but I can't seem to return any info in my Rails app.

In a video model:

VideoInfo.provider_api_keys = { youtube: ENV['YOUTUBE_API_KEY'], vimeo: ENV['VIMEO_API_KEY'] }

video = VideoInfo.new(self.url)

self.video_url              = self.url
self.provider               = video.provider
self.video_id               = video.video_id
self.title                  = video.title
self.description            = video.description
self.duration               = video.duration
self.remote_thumbnail_url   = video.thumbnail_large
self.remote_image_url       = video.thumbnail_large
self.embed_url          = video.embed_url
self.embed_code             = video.embed_code

yet all of the video attributes return null. The same url and code works perfectly in console, i.e. attributes are returned no problem.

Any ideas?

@howells
Copy link
Author

howells commented Oct 26, 2016

Oh it turns out I'm getting the error in my app - unexpected network error while fetching information about the video - but not on the console. This is my local dev machine; are you aware of issues when developing locally?

@howells
Copy link
Author

howells commented Oct 26, 2016

Somehow it's working now! No idea why it wasn't before.

@howells howells closed this as completed Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants