[vlc-commits] youtube.lua: resolve more thoroughly signature descrambling javascript URL

Pierre Ynard git at videolan.org
Wed Feb 1 07:37:38 CET 2017


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Wed Feb  1 07:35:46 2017 +0100| [f117fee08d0764c7787ae47e0f50f902db4f7c15] | committer: Pierre Ynard

youtube.lua: resolve more thoroughly signature descrambling javascript URL

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

 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 09a2af0..8bfcb97 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -281,6 +281,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