[vlc-commits] youtube.lua: update signature descrambling javascript parsing

Pierre Ynard git at videolan.org
Sun Sep 9 03:53:14 CEST 2018


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Sep  9 03:32:59 2018 +0200| [05093965224e56ffcfa357da8c67d13d2484f34d] | committer: Pierre Ynard

youtube.lua: update signature descrambling javascript parsing

The signature descrambling call has moved from using the static
"signature" string, which could be used as an obvious anchor when
parsing, to a variable field; update parsing accordingly and document
properly these parameters involved.

(cherry picked from commit c178a196d37f784437c89d004cbacc66ec0d39ae)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

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

 share/lua/playlist/youtube.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 866c888a3d..baf2002a18 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -107,8 +107,11 @@ function js_descramble( sig, js_url )
     end
 
     -- Look for the descrambler function's name
-    -- k.s&&f.set(k.sp||"signature",DK(k.s));
-    local descrambler = js_extract( js, "%.set%([^,]-\"signature\",([^)]-)%(" )
+    -- k.s&&f.set(k.sp,DK(k.s));
+    -- k.s (from stream map field "s") holds the input scrambled signature
+    -- k.sp (from stream map field "sp") holds a parameter name (normally
+    -- "signature") to set with the output, descrambled signature
+    local descrambler = js_extract( js, "%.set%([^,]-%.sp,([^)]-)%(" )
     if not descrambler then
         vlc.msg.dbg( "Couldn't extract youtube video URL signature descrambling function name" )
         return sig



More information about the vlc-commits mailing list