- return vlc.access == "http"
- and string.match( vlc.path, "youtube.com" )
- and ( string.match( vlc.path, "watch%?v=" ) -- the html page
+ if vlc.access ~= "http" then
+ return false
+ end
+ youtube_site = string.match( string.sub( vlc.path, 1, 8 ), "youtube" )
+ if not youtube_site then
+ -- FIXME we should be using a builtin list of known youtube websites
+ -- like "fr.youtube.com", "uk.youtube.com" etc..
+ youtube_site = string.find( vlc.path, ".youtube.com" )
+ if youtube_site == nil then
+ return false
+ end
+ end
+ return ( string.match( vlc.path, "watch%?v=" ) -- the html page