]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
youtube: not all urls have v= as first CGI param
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 15 Sep 2011 09:40:44 +0000 (11:40 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 15 Sep 2011 09:40:44 +0000 (11:40 +0200)
data/rbot/plugins/youtube.rb

index 01f494d1b863e367d3fe99cd381633051086f7a7..aede86e82e516d1970b25f1f20b2205518dbb0c9 100644 (file)
@@ -12,7 +12,7 @@ class YouTubePlugin < Plugin
   YOUTUBE_SEARCH = "http://gdata.youtube.com/feeds/api/videos?vq=%{words}&orderby=relevance"
   YOUTUBE_VIDEO = "http://gdata.youtube.com/feeds/api/videos/%{id}"
 
-  YOUTUBE_VIDEO_URLS = %r{youtube.com/(?:watch\?v=|v/)(.*?)(&.*)?$}
+  YOUTUBE_VIDEO_URLS = %r{youtube.com/(?:watch\?(?:.*&)?v=|v/)(.*?)(&.*)?$}
 
   Config.register Config::IntegerValue.new('youtube.hits',
     :default => 3,