[vlc-commits] youtube.lua: more generic embedded URL format handling

Pierre Ynard git at videolan.org
Mon Oct 24 08:19:48 CEST 2016


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Oct 24 07:51:00 2016 +0200| [ed082c944ad29ec03fcd78cb26d5a7ef2e7fb5c5] | committer: Pierre Ynard

youtube.lua: more generic embedded URL format handling

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed082c944ad29ec03fcd78cb26d5a7ef2e7fb5c5
---

 share/lua/playlist/youtube.lua | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index e9285e6..e336ebd 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -398,10 +398,7 @@ function parse()
         return { { path = path, title = title, artist = artist, arturl = arturl } }
 
     else -- Other supported URL formats
-        _,_,video_id = string.find( vlc.path, "/v/([^?]*)" )
-        if not video_id then
-            video_id = string.match( vlc.path, "/embed/([^?]*)" )
-        end
+        local video_id = string.match( vlc.path, "/[^/]+/([^?]*)" )
         if not video_id then
             vlc.msg.err( "Couldn't extract youtube video URL" )
             return { }



More information about the vlc-commits mailing list