thibaudgg / video_info

Get video info from Dailymotion, Vimeo, Wistia, and YouTube URLs.
https://rubygems.org/gems/video_info
MIT License
428 stars 132 forks source link

valid_url returns true with user page #223

Closed miguelpeniche closed 1 year ago

miguelpeniche commented 1 year ago

There is a minor bug, checking the Vimeo user page VideoInfo.valid_url? "https://vimeo.com/user123456789" is returning true.

markets commented 1 year ago

Hello @miguelpeniche!

This URL is checked by this method:

https://github.com/thibaudgg/video_info/blob/5fb0edff2bfeccb1ae297db741d01199837f1be5/lib/video_info/providers/vimeo.rb#L18

Feel free to send a patch to improve this scenario 🙌🏼 Probably just changing the regexp to (vimeo\.com\/(?!album|hubnut\/album|user\d+).*) will do the trick (NOTE added |user\d+). Demo: https://rubular.com/r/tLPWvBvMU8Ad6c

If you can't send a patch, I'll try to do it by myself in the following days.

Thanks for reporting!

Spone commented 1 year ago

Here is a PR for this: #228