youtube_addy icon indicating copy to clipboard operation
youtube_addy copied to clipboard

Invalid youtube urls returning array of regexs

Open zerocool4u2 opened this issue 10 years ago • 0 comments

Hi with the last merge request(may 26) i'm getting this error

YouTubeAddy.extract_video_id("asd")
 => [/^(https?:\/\/)?(www\.)?youtube.com\/watch\?(.*\&)?v=(?<id>[^&]+)/, /^(https?:\/\/)?(www\.)?youtu.be\/(?<id>[^&]+)/, /^(https?:\/\/)?(www\.)?youtube.com\/embed\/(?<id>[^&]+)/, /^(https?:\/\/)?(www\.)?youtube.com\/v\/(?<id>[^?]+)/, /^(https?:\/\/)?(www\.)?youtube.com\/apiplayer\?video_id=(?<id>[^&]+)/] 

I'm guessing the error is in the last merge between lines 19 to 22 in the file lib/youtube_addy.rb https://github.com/datwright/youtube_addy/commit/50f6723af0ed72932f7e3a222917342105f4e874 There isn't a case for a not matching encountered like the old elsif and just returning nil with invalid chars.

zerocool4u2 avatar Jun 05 '14 15:06 zerocool4u2