[vlc-commits] youtube.lua: resolve more thoroughly signature descrambling javascript URL
Pierre Ynard
git at videolan.org
Wed Feb 1 07:46:36 CET 2017
vlc/vlc-2.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Wed Feb 1 07:35:46 2017 +0100| [28ba2684be81ae2e572d93a62a640a4d3485623b] | committer: Pierre Ynard
youtube.lua: resolve more thoroughly signature descrambling javascript URL
(cherry picked from commit f117fee08d0764c7787ae47e0f50f902db4f7c15)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=28ba2684be81ae2e572d93a62a640a4d3485623b
---
share/lua/playlist/youtube.lua | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index c7615ed..d3fa4bc 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -285,6 +285,11 @@ function parse()
local js_url = string.match( line, "\"js\": *\"(.-)\"" )
if js_url then
js_url = string.gsub( js_url, "\\/", "/" )
+ -- Resolve URL
+ if string.match( js_url, "^/[^/]" ) then
+ local authority = string.match( vlc.path, "^([^/]*)/" )
+ js_url = "//"..authority..js_url
+ end
js_url = string.gsub( js_url, "^//", vlc.access.."://" )
end
More information about the vlc-commits
mailing list