kylejginavan / youtube_it

An object-oriented Ruby wrapper for the YouTube GData API
http://groups.google.com/group/ruby-youtube-library
595 stars 223 forks source link

fix vid_regex for video_id that includes hyphen #47

Closed dopin closed 12 years ago

dopin commented 12 years ago

video_id sometimes includes hyphen like this: http://youtu.be/63ASo-iq6aw

ababich commented 12 years ago

Agree, this is pretty critical

also, I'd used earlier much complex regexp and am not sure it is necessary but you should check this too,

url =~ /^.*((youtu.be\/)|(v\/)|(vi\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/

I do realy know that all links like

http://www.youtube.com/watch?v=5R_liS-PEHw http://www.youtube.com/v/5R_liS-PEHw , embed links, etc. should be recognizible by YoutubeIt

Please, release hyphen support ASAP