[vlc-commits] youtube.lua: support embedded iframe URLs

Pierre Ynard git at videolan.org
Sat Oct 25 04:01:30 CEST 2014


vlc/vlc-2.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Oct 25 03:51:45 2014 +0200| [385c1194bf58076bfd73e41ecc24b10ddafefe7f] | committer: Felix Paul Kühne

youtube.lua: support embedded iframe URLs

Closes #11878

(cherry picked from commit 77f58c382703f93e899683844d1917cd7cb69d22)
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

 share/lua/playlist/youtube.lua |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 44b7bac..24c4cf7 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -215,6 +215,7 @@ function probe()
     return (  string.match( vlc.path, "/watch%?" ) -- the html page
             or string.match( vlc.path, "/get_video_info%?" ) -- info API
             or string.match( vlc.path, "/v/" ) -- video in swf player
+            or string.match( vlc.path, "/embed/" ) -- embedded player iframe
             or string.match( vlc.path, "/player2.swf" ) ) -- another player url
 end
 
@@ -374,6 +375,9 @@ function parse()
             _,_,video_id = string.find( vlc.path, "/v/([^?]*)" )
         end
         if not video_id then
+            video_id = string.match( vlc.path, "/embed/([^?]*)" )
+        end
+        if not video_id then
             vlc.msg.err( "Couldn't extract youtube video URL" )
             return { }
         end



More information about the vlc-commits mailing list