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

NoMethodError with Youtube Scraper when the video has no description #180

Closed
Spone opened this issue Mar 9, 2018 · 1 comment
Closed

Comments

@Spone
Copy link
Contributor

Spone commented Mar 9, 2018

$ video = VideoInfo.new("https://www.youtube.com/watch?v=WVsj2pS-zFY")
=> #<VideoInfo:0x00007ff674bbca20 @provider=#<VideoInfo::Providers::Youtube:0x00007ff674bafd98 @options={"User-Agent"=>"VideoInfo/2.7"}, @url="https://www.youtube.com/watch?v=WVsj2pS-zFY", @video_id="WVsj2pS-zFY">>
$ video.description
NoMethodError (undefined method `value' for nil:NilClass)

I expect video.description to return nil when no description is found, instead of raising NoMethodError.

I think this is the line where it should be fixed: https://github.com/thibaudgg/video_info/blob/master/lib/video_info/providers/youtube_scraper.rb#L67

@thibaudgg
Copy link
Owner

Hi @Spone, thanks for the opening this issue. Could you please open a pull request with a fix, I'll review it quickly.

Spone added a commit to Spone/video_info that referenced this issue Mar 9, 2018
@vheuken vheuken closed this as completed Sep 12, 2018
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

3 participants