[vlc-commits] youtube.lua: update signature descrambling javascript parsing
    Pierre Ynard 
    git at videolan.org
       
    Sun Sep  9 03:49:28 CEST 2018
    
    
  
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Sep  9 03:32:59 2018 +0200| [c178a196d37f784437c89d004cbacc66ec0d39ae] | 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c178a196d37f784437c89d004cbacc66ec0d39ae
---
 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