Commit 385c1194 authored by Pierre Ynard's avatar Pierre Ynard Committed by Felix Paul Kühne

youtube.lua: support embedded iframe URLs

Closes #11878

(cherry picked from commit 77f58c382703f93e899683844d1917cd7cb69d22)
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 60ff09fe
...@@ -215,6 +215,7 @@ function probe() ...@@ -215,6 +215,7 @@ function probe()
return ( string.match( vlc.path, "/watch%?" ) -- the html page return ( string.match( vlc.path, "/watch%?" ) -- the html page
or string.match( vlc.path, "/get_video_info%?" ) -- info API 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, "/v/" ) -- video in swf player
or string.match( vlc.path, "/embed/" ) -- embedded player iframe
or string.match( vlc.path, "/player2.swf" ) ) -- another player url or string.match( vlc.path, "/player2.swf" ) ) -- another player url
end end
...@@ -373,6 +374,9 @@ function parse() ...@@ -373,6 +374,9 @@ function parse()
if not video_id then if not video_id then
_,_,video_id = string.find( vlc.path, "/v/([^?]*)" ) _,_,video_id = string.find( vlc.path, "/v/([^?]*)" )
end end
if not video_id then
video_id = string.match( vlc.path, "/embed/([^?]*)" )
end
if not video_id then if not video_id then
vlc.msg.err( "Couldn't extract youtube video URL" ) vlc.msg.err( "Couldn't extract youtube video URL" )
return { } return { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment